Class RegTransient.Builder

java.lang.Object
org.oristool.models.stpn.trans.RegTransient.Builder
Enclosing class:
RegTransient

public abstract static class RegTransient.Builder extends Object
  • Method Details

    • timeBound

      public abstract RegTransient.Builder timeBound(BigDecimal value)
      Sets the maximum time bound for the analysis.

      This parameter has no default value; it must be specified by the user.

      Parameters:
      value - bound of transient probabilities
      Returns:
      this builder instance
    • timeStep

      public abstract RegTransient.Builder timeStep(BigDecimal value)
      Sets the step used to compute transient probabilities from 0 to this.timeBound().

      This parameter has no default value; it must be specified by the user.

      Parameters:
      value - of transient probabilities
      Returns:
      this builder instance
    • policy

      public abstract RegTransient.Builder policy(Supplier<EnumerationPolicy> value)
      Sets the supplier of enumeration policies used by this analysis.

      A new policy instance is generated for for each tree (and for each run of the analysis).

      By default, a FIFO policy is used.

      The builder method greedyPolicy(timeBound, error) can be used to use a TruncationPolicy with given timeBound and allowed error.

      Parameters:
      value - the supplier of state class expansion policies
      Returns:
      this builder instance
    • greedyPolicy

      public RegTransient.Builder greedyPolicy(BigDecimal timeBound, BigDecimal error)
      Sets the time bound for the analysis (similarly to timeBound(BigDecimal)) and a greedy policy controlling the enumeration of nodes.

      The node with largest reaching probability is expanded first. The enumeration is halted if the probability of finding the STPN in a state of the frontier set at the time bound (and thus at any time before that) is lower than error.

      A new policy instance is generated for each tree and for each run.

      Note that partial enumeration of transient trees between regenerations can produce defective kernels for the MRP. The output probabilities will be a lower bound of their correct values (with total error increasing over time). For a better approximation (but with no lower-bound guarantee) set normalizeKernels(true).

      Parameters:
      timeBound - bound of transient probabilities
      error - the allowed error at each time before the time bound
      Returns:
      this builder instance
    • localEvaluationPeriod

      public abstract RegTransient.Builder localEvaluationPeriod(int steps)
      Sets the evaluation period for the local kernel (in time steps).

      When greater than 1, the most recent sample is repeated until the next evaluation tick.

      By default, the local kernel is evaluated at each time step.

      Parameters:
      steps - the local kernel evaluation period
      Returns:
      this builder instance
    • globalEvaluationPeriod

      public abstract RegTransient.Builder globalEvaluationPeriod(int steps)
      Sets the evaluation period for the global kernel (in time steps).

      When greater than 1, the most recent sample is repeated until the next evaluation tick.

      By default, the global kernel is evaluated at each time step.

      Parameters:
      steps - the global kernel evaluation period
      Returns:
      this builder instance
    • normalizeKernels

      public abstract RegTransient.Builder normalizeKernels(boolean value)
      Enables the normalization of rows in local and global kernels.

      Without normalization, defective kernel rows produce probabilities that sum less than 1, but they are guaranteed to be lower bounds of the exact values.

      With normalization, the output probabilities always sum to 1, but they can include an error increasing over time, and overestimate or underestimate the exact values.

      By default, kernel normalization is not enabled.

      Parameters:
      value - true to enable kernel normalization
      Returns:
      this builder instance
    • stopOn

      public RegTransient.Builder stopOn(MarkingCondition value)
      Uses a marking condition to create local stop criterion instances used by this analysis. It can be used to avoid the expansion of some state classes, as if their states were absorbing.
      Parameters:
      value - the supplier of local stop criterion
      Returns:
      this builder instance
    • stopOn

      public abstract RegTransient.Builder stopOn(Supplier<StopCriterion> value)
      Sets the supplier of local stop criterion instances used by this analysis. It can be used to avoid the expansion of some state classes, as if their states were absorbing.

      A stop criterion instance is generated for each run.

      By default, an always-false local stop criterion is used.

      Parameters:
      value - the supplier of local stop criterion
      Returns:
      this builder instance
    • markingFilter

      public abstract RegTransient.Builder markingFilter(MarkingCondition value)
      Uses a marking condition to select markings for which transient probabilities are computed by this analysis.

      By default, transient probabilities are computed for all markings.

      Parameters:
      value - the filter selecting markings for transient analysis
      Returns:
      this builder instance
    • monitor

      public abstract RegTransient.Builder monitor(AnalysisMonitor value)
      Sets the monitor used by this analysis. It is used to stop the analysis early and to notify messages to the user.

      By default, an always-false, message-discarding monitor is used.

      Parameters:
      value - the monitor used by this analysis
      Returns:
      this builder instance
    • logger

      public abstract RegTransient.Builder logger(AnalysisLogger value)
      Sets the logger used by this analysis. It is used to print progress information.

      By default, logs are discarded.

      Parameters:
      value - the logger used by this analysis
      Returns:
      this builder instance
    • build

      public abstract RegTransient build()
      Builds a new instance with the provided configurations.
      Returns:
      a new TimedAnalysis instance