Program: 73026
Project: 73026
Buggy source:
/** 
 * Check if event is safe to process.
 * @param event The event to be checked.
 * @return true if the event is safe to process.
 * @exception IllegalActionException If the delayOffset a parametercannot be read.
 */
private boolean _isSafeToProcess(PtidesEvent event) throws IllegalActionException {
  Time eventTimestamp=event.timeStamp();
  IOPort port=event.ioPort();
  Double delayOffset=null;
  StartOrResumable metroActor=_actorDictionary.get(event.actor().getFullName());
  if (metroActor.getState() != State.START) {
    System.out.println(metroActor.getState());
    System.out.println(State.START);
    return false;
  }
  Integer maxFutureEvents=_getIntParameterValue((NamedObj)event.actor(),"String_Node_Str");
  if (maxFutureEvents != null) {
    int futureEvents=_getNumberOfFutureEventsFrom(event.actor());
    if (futureEvents > maxFutureEvents) {
      return false;
    }
 else {
      return true;
    }
  }
  if (port != null) {
    Actor actor=(Actor)port.getContainer();
    for (    Object ioPort : actor.inputPortList()) {
      Double ioPortDelayOffset=_getDoubleParameterValue((NamedObj)ioPort,"String_Node_Str");
      if (ioPortDelayOffset != null && (delayOffset == null || ioPortDelayOffset < delayOffset)) {
        delayOffset=ioPortDelayOffset;
      }
    }
  }
 else {
    delayOffset=_getDoubleParameterValue((NamedObj)event.actor(),"String_Node_Str");
  }
  if (delayOffset == null || localClock.getLocalTime().compareTo(eventTimestamp.subtract(delayOffset)) >= 0) {
    return true;
  }
  _setNextFireTime(eventTimestamp.subtract(delayOffset));
  return false;
}

Fixed version (ground truth):
/** 
 * Check if event is safe to process.
 * @param event The event to be checked.
 * @return true if the event is safe to process.
 * @exception IllegalActionException If the delayOffset a parametercannot be read.
 */
private boolean _isSafeToProcess(PtidesEvent event) throws IllegalActionException {
  if (getFiringEventSize() > 0 && event.depth() > getCurrentEventDepth()) {
    return false;
  }
  Time eventTimestamp=event.timeStamp();
  IOPort port=event.ioPort();
  Double delayOffset=null;
  StartOrResumable metroActor=_actorDictionary.get(event.actor().getFullName());
  if (metroActor.getState() != State.START) {
    System.out.println(metroActor.getState());
    System.out.println(State.START);
    return false;
  }
  Integer maxFutureEvents=_getIntParameterValue((NamedObj)event.actor(),"String_Node_Str");
  if (maxFutureEvents != null) {
    int futureEvents=_getNumberOfFutureEventsFrom(event.actor());
    if (futureEvents > maxFutureEvents) {
      return false;
    }
 else {
      return true;
    }
  }
  if (port != null) {
    Actor actor=(Actor)port.getContainer();
    for (    Object ioPort : actor.inputPortList()) {
      Double ioPortDelayOffset=_getDoubleParameterValue((NamedObj)ioPort,"String_Node_Str");
      if (ioPortDelayOffset != null && (delayOffset == null || ioPortDelayOffset < delayOffset)) {
        delayOffset=ioPortDelayOffset;
      }
    }
  }
 else {
    delayOffset=_getDoubleParameterValue((NamedObj)event.actor(),"String_Node_Str");
  }
  if (delayOffset == null || localClock.getLocalTime().compareTo(eventTimestamp.subtract(delayOffset)) >= 0) {
    return true;
  }
  _setNextFireTime(eventTimestamp.subtract(delayOffset));
  return false;
}