Program: 72519
Project: 72519
Buggy source:
/** 
 * Trigger a rate-event if necessary. <p>Update the internal, continuous state models.</p>
 * @param currentTime The current simulation time.
 * @param force If true, always trigger a rate-event. Otherwise,only trigger a rate-event if an input changed or if the integrator signals it needs one to satisfy internal logic.
 */
private final void _triggerRateEvent(final Time currentTime,final boolean force) throws IllegalActionException {
  if (_debugging) {
    _debugToStdOut(String.format("String_Node_Str",System.identityHashCode(this),currentTime.toString()));
  }
  int curIdx=0;
  boolean updatedInputVarMdl=false;
  for (  Input input : _inputs) {
    assert(input.port.isKnown(0));
    if (input.port.hasNewToken(0)) {
      final Token token=input.port.get(0);
      if (!token.equals(input.lastInput)) {
        final ModelPolynomial ivMdl=_inputVariableModels[curIdx];
        _setModelFromToken(ivMdl,token);
        ivMdl.tMdl=currentTime;
        _inputs.get(curIdx).lastInput=token;
        _inputs.get(curIdx).hasChanged=true;
        if (_debugging) {
          _debugToStdOut(String.format("String_Node_Str",System.identityHashCode(this),curIdx,ivMdl.toString()));
        }
      }
      updatedInputVarMdl=true;
    }
    curIdx++;
  }
  assert(_qssSolver.getInputVariableCount() == curIdx);
  if (force || updatedInputVarMdl || _qssSolver.needRateEvent()) {
    if (_debugging) {
      _debugToStdOut(String.format("String_Node_Str",System.identityHashCode(this),force,updatedInputVarMdl,_qssSolver.needRateEvent()));
    }
    try {
      _qssSolver.triggerRateEvent();
    }
 catch (    Exception ee) {
      throw new IllegalActionException(this,ee,"String_Node_Str");
    }
  }
}

Fixed version (ground truth):
/** 
 * Trigger a rate-event if necessary. <p>Update the internal, continuous state models.</p>
 * @param currentTime The current simulation time.
 * @param force If true, always trigger a rate-event. Otherwise,only trigger a rate-event if an input changed or if the integrator signals it needs one to satisfy internal logic.
 */
private final void _triggerRateEvent(final Time currentTime,final boolean force) throws IllegalActionException {
  if (_debugging) {
    _debugToStdOut(String.format("String_Node_Str",System.identityHashCode(this),currentTime.toString()));
  }
  int curIdx=0;
  boolean updatedInputVarMdl=false;
  for (  Input input : _inputs) {
    assert(input.port.isKnown(0));
    if (input.port.hasNewToken(0)) {
      final Token token=input.port.get(0);
      final ModelPolynomial ivMdl=_inputVariableModels[curIdx];
      _setModelFromToken(ivMdl,token);
      ivMdl.tMdl=currentTime;
      _inputs.get(curIdx).lastInput=token;
      _inputs.get(curIdx).hasChanged=true;
      if (_debugging) {
        _debugToStdOut(String.format("String_Node_Str",System.identityHashCode(this),curIdx,ivMdl.toString()));
      }
      updatedInputVarMdl=true;
    }
    curIdx++;
  }
  assert(_qssSolver.getInputVariableCount() == curIdx);
  if (force || updatedInputVarMdl || _qssSolver.needRateEvent()) {
    if (_debugging) {
      _debugToStdOut(String.format("String_Node_Str",System.identityHashCode(this),force,updatedInputVarMdl,_qssSolver.needRateEvent()));
    }
    try {
      _qssSolver.triggerRateEvent();
    }
 catch (    Exception ee) {
      throw new IllegalActionException(this,ee,"String_Node_Str");
    }
  }
}