Program: 73241
Project: 73241
Buggy source:
/** 
 * Return the actor to fire in this iteration, or null if no actor should be fired. To simulate execution time, an event may be marked as being processed, but the actor is only fired when execution time expires. This is based on the assumption that an actor only produces events when it is done firing, not during firing. Since _checkForNextEvent() always returns true, this method will keep being called until it returns null.  
 * @exception IllegalActionException If getPlatformPhysicalTag() throws it.
 */
protected Actor _getNextActorToFire() throws IllegalActionException {
  Tag executionPhysicalTag=getPlatformPhysicalTag(executionTimeClock);
  _runScheduler(executionPhysicalTag);
  Time nextFinishTime=null;
  for (  Stack<ProcessingPtidesEvents> coreStack : _currentlyProcessingEvents) {
    if (coreStack.size() != 0) {
      ProcessingPtidesEvents processingEvent=coreStack.peek();
      int compare=processingEvent.finishTime.compareTo(executionPhysicalTag.timestamp);
      if (compare == 0) {
        PtidesEvent eventToFire=processingEvent.events.get(0);
        setTag(eventToFire.timeStamp(),eventToFire.microstep());
        coreStack.pop();
        _saveEventInformation(processingEvent.events);
        _lastActorFired=eventToFire.actor();
        _lastExecutionTime=executionPhysicalTag.timestamp;
        return eventToFire.actor();
      }
 else       if (compare < 0) {
        throw new IllegalActionException(this,"String_Node_Str" + processingEvent);
      }
 else {
        if (nextFinishTime == null) {
          nextFinishTime=processingEvent.finishTime;
        }
 else         if (processingEvent.finishTime.compareTo(nextFinishTime) < 0) {
          nextFinishTime=processingEvent.finishTime;
        }
      }
    }
  }
  if (nextFinishTime != null) {
    _fireAtPlatformTime(nextFinishTime,executionTimeClock);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Return the actor to fire in this iteration, or null if no actor should be fired. To simulate execution time, an event may be marked as being processed, but the actor is only fired when execution time expires. This is based on the assumption that an actor only produces events when it is done firing, not during firing. Since _checkForNextEvent() always returns true, this method will keep being called until it returns null.  
 * @exception IllegalActionException If getPlatformPhysicalTag() throws it.
 */
protected Actor _getNextActorToFire() throws IllegalActionException {
  Tag executionPhysicalTag=getPlatformPhysicalTag(executionTimeClock);
  _runScheduler(executionPhysicalTag);
  Time nextFinishTime=null;
  for (int i=0; i < _currentlyProcessingEvents.size(); i++) {
    Stack<ProcessingPtidesEvents> coreStack=_currentlyProcessingEvents.get(i);
    if (coreStack.size() != 0) {
      ProcessingPtidesEvents processingEvent=coreStack.peek();
      int compare=processingEvent.finishTime.compareTo(executionPhysicalTag.timestamp);
      if (compare == 0) {
        PtidesEvent eventToFire=processingEvent.events.get(0);
        setTag(eventToFire.timeStamp(),eventToFire.microstep());
        coreStack.pop();
        _sendExecutionTimeEvent(eventToFire.actor(),executionPhysicalTag.timestamp.getDoubleValue(),ExecutionEventType.STOP,i);
        _saveEventInformation(processingEvent.events);
        _lastActorFired=eventToFire.actor();
        _lastExecutionTime=executionPhysicalTag.timestamp;
        return eventToFire.actor();
      }
 else       if (compare < 0) {
        throw new IllegalActionException(this,"String_Node_Str" + processingEvent);
      }
 else {
        if (nextFinishTime == null) {
          nextFinishTime=processingEvent.finishTime;
        }
 else         if (processingEvent.finishTime.compareTo(nextFinishTime) < 0) {
          nextFinishTime=processingEvent.finishTime;
        }
      }
    }
  }
  if (nextFinishTime != null) {
    _debug("String_Node_Str" + nextFinishTime);
    _fireAtPlatformTime(nextFinishTime,executionTimeClock);
  }
  return null;
}