extension/src/main/java/org/justinnk/masonssa/extension/ssa/NextReactionMethod.java
/**
   * Initialise a an action. This will recalculate its rate and guard and schedule its next event if
   * the action is applicable.
   *
   * @param action The action to initialise.
   */
Initialise a an action. This will recalculate its rate and guard and schedule its next event if
the action is applicable.

@param action The action to initialise.
Initialise a an action . This will recalculate its rate and guard and schedule its next event if the action is applicable . @param action The action to initialise .
public void initAction(Action action) {
    if (action.evaluateCondition()) {
      double rate = action.calculateRate();
      if (rate > 0) {
        double waitingTime = expDist(rate);
        TentativeStep step =
            new TentativeStep(
                new Steppable() {
                  private static final long serialVersionUID = 1L;
                  @Override
                  public void step(SimState state) {
                    executeAction(action);
                  }
                });
        double currentTime = state.schedule.getTime();
        state.schedule.scheduleOnceIn(waitingTime, step);
        action.resetNextEvent(step, waitingTime + currentTime);
      }
    }
  }
public void initAction ( Action action ) { if ( action . evaluateCondition ( ) ) { double rate = action . calculateRate ( ) ; if ( rate > 0 ) { double waitingTime = expDist ( rate ) ; TentativeStep step = new TentativeStep ( new Steppable ( ) { private static final long serialVersionUID = 1L ; @ Override public void step ( SimState state ) { executeAction ( action ) ; } } ) ; double currentTime = state . schedule . getTime ( ) ; state . schedule . scheduleOnceIn ( waitingTime , step ) ; action . resetNextEvent ( step , waitingTime + currentTime ) ; } } }
Initialise a an action.
Initialise a an action .