Program: 72561
Project: 72561
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 currIdx=0;
  boolean updatedInputVarMdl=false;
  for (  Input input : _inputs) {
    assert(input.port.isKnown(0));
    if (input.port.hasToken(0)) {
      final Token token=input.port.get(0);
      final ModelPolynomial ivMdl=_inputVariableModels[currIdx];
      final int order=_qssSolver.getStateModelOrder();
      _getModelFromPort(order,ivMdl,token);
      ivMdl.tMdl=currentTime;
      updatedInputVarMdl=true;
      _inputs.get(currIdx).hasChanged=true;
      if (_debugging) {
        _debugToStdOut(String.format("String_Node_Str",System.identityHashCode(this),currIdx,ivMdl.toString()));
      }
    }
    currIdx++;
  }
  assert(_qssSolver.getInputVariableCount() == currIdx);
  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 currIdx=0;
  boolean updatedInputVarMdl=false;
  for (  Input input : _inputs) {
    assert(input.port.isKnown(0));
    if (input.port.hasToken(0)) {
      final Token token=input.port.get(0);
      final ModelPolynomial ivMdl=_inputVariableModels[currIdx];
      _getModelFromToken(ivMdl,token);
      ivMdl.tMdl=currentTime;
      updatedInputVarMdl=true;
      _inputs.get(currIdx).hasChanged=true;
      if (_debugging) {
        _debugToStdOut(String.format("String_Node_Str",System.identityHashCode(this),currIdx,ivMdl.toString()));
      }
    }
    currIdx++;
  }
  assert(_qssSolver.getInputVariableCount() == currIdx);
  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");
    }
  }
}