Program: 75557
Project: 75557
Buggy source:
/** 
 * Execute the model for one iteration. It first compare the current time to the time stamp of the first event in the interrupt event queue. If they are equal, then dequeue the events at the current time from the interrupt event queue, and fire the destination actors. If the current time is less than the time stamp of the first event in the interrupt event queue, then look at the TM event queue. Pick the task with the highest priority and start/continue its execution. If the task has <i>executionTime</i> being zero, then finish that task. Otherwise, finish its execution util time advances.
 * @exception IllegalActionException If an interrupt is in the past,or one of the execution methods of an actor throws it.
 */
public void fire() throws IllegalActionException {
  _nextIterationTime=((DoubleToken)stopTime.getToken()).doubleValue();
  while (!_interruptQueue.isEmpty()) {
    DEEvent interruptEvent=(DEEvent)_interruptQueue.get();
    double timeStamp=interruptEvent.timeStamp();
    if ((timeStamp + 1e-10) < getCurrentTime()) {
      throw new IllegalActionException(this,"String_Node_Str" + "String_Node_Str" + timeStamp + "String_Node_Str"+ getCurrentTime());
    }
 else     if (timeStamp == getCurrentTime()) {
      _interruptQueue.take();
      Actor actor=interruptEvent.actor();
      if (actor != null) {
        if (actor.prefire()) {
          actor.fire();
          if (!actor.postfire()) {
            _disableActor(actor);
          }
        }
      }
    }
 else {
      _nextIterationTime=timeStamp;
      break;
    }
  }
  TMEvent event=null;
  while (!_eventQueue.isEmpty()) {
    event=(TMEvent)_eventQueue.get();
    if (_debugging)     _debug("String_Node_Str",event.toString());
    if (!event.hasStarted()) {
      if (_debugging)       _debug(getName(),"String_Node_Str",event.toString(),"String_Node_Str" + ((NamedObj)event.actor()).getName() + "String_Node_Str");
      event.receiver()._triggerEvent(event.token());
      Actor actor=event.actor();
      if (actor == getContainer() || !actor.prefire()) {
        _eventQueue.take();
        event=null;
      }
 else {
        double processingTime=((DoubleToken)defaultTaskExecutionTime.getToken()).doubleValue();
        if (actor instanceof TMActor) {
          processingTime=((TMActor)actor).getExecutionTime();
        }
 else {
          Parameter executionTime=(Parameter)((IOPort)event.receiver().getContainer()).getAttribute("String_Node_Str");
          if (executionTime == null) {
            executionTime=(Parameter)((NamedObj)actor).getAttribute("String_Node_Str");
          }
          if (executionTime != null) {
            processingTime=((DoubleToken)executionTime.getToken()).doubleValue();
          }
        }
        if (processingTime == 0.0) {
          if (_debugging)           _debug(getName(),event.toString(),"String_Node_Str");
          _eventQueue.take();
          actor.fire();
          _displaySchedule(((Nameable)actor).getName(),getCurrentTime(),ScheduleListener.TASK_SLEEPING);
          _displaySchedule();
          if (!actor.postfire()) {
            _disableActor(actor);
          }
        }
 else {
          event.setProcessingTime(processingTime);
          if (_debugging)           _debug("String_Node_Str",event.toString());
          _preemptive=((BooleanToken)preemptive.getToken()).booleanValue();
          if (!_preemptive) {
            event=(TMEvent)_eventQueue.take();
            event.startProcessing();
            event.setPriority(0);
            _eventQueue.put(event);
          }
 else {
            event.startProcessing();
          }
          if (_debugging)           _debug("String_Node_Str",event.toString());
          _displaySchedule();
          break;
        }
      }
    }
 else {
      break;
    }
  }
  if (event != null && event.processingTime() > 0) {
    double finishTime=getCurrentTime() + event.processingTime();
    if (_debugging)     _debug("String_Node_Str" + finishTime);
    if (finishTime < _nextIterationTime) {
      _nextIterationTime=finishTime;
    }
  }
  if (_isEmbedded() && _nextIterationTime < Double.MAX_VALUE) {
    _requestFiringAt(_nextIterationTime);
  }
}

Fixed version (ground truth):
/** 
 * Execute the model for one iteration. It first compare the current time to the time stamp of the first event in the interrupt event queue. If they are equal, then dequeue the events at the current time from the interrupt event queue, and fire the destination actors. If the current time is less than the time stamp of the first event in the interrupt event queue, then look at the TM event queue. Pick the task with the highest priority and start/continue its execution. If the task has <i>executionTime</i> being zero, then finish that task. Otherwise, finish its execution util time advances.
 * @exception IllegalActionException If an interrupt is in the past,or one of the execution methods of an actor throws it.
 */
public void fire() throws IllegalActionException {
  if (_debugging)   _debug("String_Node_Str");
  _nextIterationTime=((DoubleToken)stopTime.getToken()).doubleValue();
  while (!_interruptQueue.isEmpty()) {
    DEEvent interruptEvent=(DEEvent)_interruptQueue.get();
    double timeStamp=interruptEvent.timeStamp();
    if ((timeStamp + 1e-10) < getCurrentTime()) {
      throw new IllegalActionException(this,"String_Node_Str" + "String_Node_Str" + timeStamp + "String_Node_Str"+ getCurrentTime());
    }
 else     if (timeStamp == getCurrentTime()) {
      _interruptQueue.take();
      Actor actor=interruptEvent.actor();
      if (actor != null) {
        if (actor.prefire()) {
          actor.fire();
          if (!actor.postfire()) {
            _disableActor(actor);
          }
        }
      }
    }
 else {
      _nextIterationTime=timeStamp;
      break;
    }
  }
  TMEvent event=null;
  while (!_eventQueue.isEmpty()) {
    event=(TMEvent)_eventQueue.get();
    if (_debugging)     _debug("String_Node_Str",event.toString());
    if (!event.hasStarted()) {
      if (_debugging)       _debug(getName(),"String_Node_Str",event.toString(),"String_Node_Str" + ((NamedObj)event.actor()).getName() + "String_Node_Str");
      event.receiver()._triggerEvent(event.token());
      Actor actor=event.actor();
      if (actor == getContainer() || !actor.prefire()) {
        _eventQueue.take();
        event=null;
      }
 else {
        double processingTime=((DoubleToken)defaultTaskExecutionTime.getToken()).doubleValue();
        if (actor instanceof TMActor) {
          processingTime=((TMActor)actor).getExecutionTime();
        }
 else {
          Parameter executionTime=(Parameter)((IOPort)event.receiver().getContainer()).getAttribute("String_Node_Str");
          if (executionTime == null) {
            executionTime=(Parameter)((NamedObj)actor).getAttribute("String_Node_Str");
          }
          if (executionTime != null) {
            processingTime=((DoubleToken)executionTime.getToken()).doubleValue();
          }
        }
        if (processingTime == 0.0) {
          if (_debugging)           _debug(getName(),event.toString(),"String_Node_Str");
          _eventQueue.take();
          actor.fire();
          _displaySchedule(((Nameable)actor).getName(),getCurrentTime(),ScheduleListener.TASK_SLEEPING);
          _displaySchedule();
          if (!actor.postfire()) {
            _disableActor(actor);
          }
        }
 else {
          event.setProcessingTime(processingTime);
          if (_debugging)           _debug("String_Node_Str",event.toString());
          _preemptive=((BooleanToken)preemptive.getToken()).booleanValue();
          if (!_preemptive) {
            event=(TMEvent)_eventQueue.take();
            event.startProcessing();
            event.setPriority(0);
            _eventQueue.put(event);
          }
 else {
            event.startProcessing();
          }
          if (_debugging)           _debug("String_Node_Str",event.toString());
          _displaySchedule();
          break;
        }
      }
    }
 else {
      break;
    }
  }
  if (event != null && event.processingTime() > 0) {
    double finishTime=getCurrentTime() + event.processingTime();
    if (_debugging)     _debug("String_Node_Str" + finishTime);
    if (finishTime < _nextIterationTime) {
      _nextIterationTime=finishTime;
    }
  }
  if (_isEmbedded() && _nextIterationTime < Double.MAX_VALUE) {
    _requestFiringAt(_nextIterationTime);
  }
}