Program: 76349
Project: 76349
Buggy source:
/** 
 * Simulate the creation of tokens by the given output port when its actor fires.  If any actors that receive tokens are then ready to fire, given that only actors in the actor list are being scheduled, then add those actors to the list of actors that are ready to schedule. update the waiting tokens map with the tokens available on each channel of each port.
 */
private void _simulateTokensCreated(IOPort outputPort,int createdTokens,CircularList actorList,CircularList readyToScheduleActorList,LLMap waitingTokens) throws IllegalActionException {
  _debug("String_Node_Str" + createdTokens + "String_Node_Str"+ outputPort.getFullName());
  Receiver[][] creceivers=outputPort.getRemoteReceivers();
  _debug("String_Node_Str" + creceivers.length);
  int sourcechannel;
  for (sourcechannel=0; sourcechannel < creceivers.length; sourcechannel++) {
    _debug("String_Node_Str" + creceivers[sourcechannel].length);
    int destinationreceiver;
    for (destinationreceiver=0; destinationreceiver < creceivers[sourcechannel].length; destinationreceiver++) {
      IOPort connectedPort=(IOPort)creceivers[sourcechannel][destinationreceiver].getContainer();
      ComponentEntity connectedActor=(ComponentEntity)connectedPort.getContainer();
      if (actorList.includes(connectedActor)) {
        int destinationchannel=_getChannel(connectedPort,creceivers[sourcechannel][destinationreceiver]);
        int[] tokens=(int[])waitingTokens.at(connectedPort);
        tokens[destinationchannel]+=createdTokens;
        _debug("String_Node_Str" + destinationchannel + "String_Node_Str"+ connectedPort.getName());
        int ival=_countUnfulfilledInputs((Actor)connectedActor,actorList,waitingTokens);
        int firingsRemaining=_getFiringCount(connectedActor);
        if ((ival <= 0) && (firingsRemaining > 0)) {
          readyToScheduleActorList.insertLast(connectedActor);
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Simulate the creation of tokens by the given output port when its actor fires.  If any actors that receive tokens are then ready to fire, given that only actors in the actor list are being scheduled, then add those actors to the list of actors that are ready to schedule. update the waiting tokens map with the tokens available on each channel of each port.
 */
private void _simulateTokensCreated(IOPort outputPort,int createdTokens,LinkedList actorList,LinkedList readyToScheduleActorList,Map waitingTokens) throws IllegalActionException {
  _debug("String_Node_Str" + createdTokens + "String_Node_Str"+ outputPort.getFullName());
  Receiver[][] creceivers=outputPort.getRemoteReceivers();
  _debug("String_Node_Str" + creceivers.length);
  int sourcechannel;
  for (sourcechannel=0; sourcechannel < creceivers.length; sourcechannel++) {
    _debug("String_Node_Str" + creceivers[sourcechannel].length);
    int destinationreceiver;
    for (destinationreceiver=0; destinationreceiver < creceivers[sourcechannel].length; destinationreceiver++) {
      IOPort connectedPort=(IOPort)creceivers[sourcechannel][destinationreceiver].getContainer();
      ComponentEntity connectedActor=(ComponentEntity)connectedPort.getContainer();
      if (actorList.contains(connectedActor)) {
        int destinationchannel=_getChannel(connectedPort,creceivers[sourcechannel][destinationreceiver]);
        int[] tokens=(int[])waitingTokens.get(connectedPort);
        tokens[destinationchannel]+=createdTokens;
        _debug("String_Node_Str" + destinationchannel + "String_Node_Str"+ connectedPort.getName());
        int ival=_countUnfulfilledInputs((Actor)connectedActor,actorList,waitingTokens);
        int firingsRemaining=_getFiringCount(connectedActor);
        if ((ival <= 0) && (firingsRemaining > 0)) {
          readyToScheduleActorList.addLast(connectedActor);
        }
      }
    }
  }
}