Program: 72676
Project: 72676
Buggy source:
/** 
 * Initiate a send of the specified token to the specified receiver. This method will schedule a refiring of this actor according to the requirements of the AFDX protocol.
 * @param source Sender of the token.
 * @param receiver The receiver to send to.
 * @param token The token to send.
 * @exception IllegalActionException If the refiring request fails.
 */
@Override public void sendToken(Receiver source,Receiver receiver,Token token) throws IllegalActionException {
  Time currentTime=getDirector().getModelTime();
  Time lastTimeStamp=null;
  boolean multicast=false;
  IOPort receiverContainer=receiver.getContainer();
  Actor emitterSource=((IntermediateReceiver)source).source;
  AFDXVlink vl=_portToVirtualLinks.get(receiverContainer);
  vl.setSource(emitterSource);
  if (!_lastEmissionTable.containsKey(vl.getName())) {
    _lastEmissionTable.put(vl.getName(),new Time(getDirector(),currentTime.getDoubleValue()));
  }
  if (!_virtualLinkTable.containsKey(vl.getName())) {
    _virtualLinkTable.put(vl.getName(),vl);
  }
  if (!_afdxSchedMuxsQueue.containsKey(vl.getSchedulerMux())) {
    _afdxSchedMuxsQueue.put(vl.getSchedulerMux(),new LinkedList<TimedEvent>());
  }
  if (!_afdxVLinksQueue.containsKey(vl.getName())) {
    _afdxVLinksQueue.put(vl.getName(),new LinkedList());
  }
  if (_afdxVLinksQueue.get(vl.getName()).size() > 0) {
    lastTimeStamp=_afdxVLinksQueue.get(vl.getName()).getLast().timeStamp;
    Object[] output=(Object[])_afdxVLinksQueue.get(vl.getName()).getLast().contents;
    if (((AFDXVlink)output[2]).getSource().equals(((IntermediateReceiver)source).source) && ((Time)output[3]).compareTo(currentTime) == 0) {
      multicast=true;
    }
  }
 else {
    lastTimeStamp=_lastEmissionTable.get(vl.getName());
  }
  if (multicast) {
    _lastEmissionTable.put(vl.getName(),lastTimeStamp);
    _afdxVLinksQueue.get(vl.getName()).add(new TimedEvent(lastTimeStamp,new Object[]{receiver,token,vl,currentTime}));
    multicast=false;
  }
 else {
    if (lastTimeStamp.compareTo(currentTime) == 0 && _afdxVLinksQueue.get(vl.getName()).size() < 1) {
      _delay=0.0;
    }
 else     if (lastTimeStamp.add(vl.getBag()).compareTo(currentTime) < 0) {
      _delay=0.0;
    }
 else     if (lastTimeStamp.add(vl.getBag()).compareTo(currentTime) == 0) {
      _delay=0.0;
    }
 else     if (lastTimeStamp.add(vl.getBag()).compareTo(currentTime) > 0) {
      _delay=lastTimeStamp.add(vl.getBag()).subtract(currentTime).getDoubleValue();
    }
    _lastEmissionTable.put(vl.getName(),currentTime.add(_delay));
    _afdxVLinksQueue.get(vl.getName()).add(new TimedEvent(currentTime.add(_delay),new Object[]{receiver,token,vl,currentTime}));
  }
  _tokenCount++;
  _scheduleRefire();
}

Fixed version (ground truth):
/** 
 * Initiate a send of the specified token to the specified receiver. This method will schedule a refiring of this actor according to the requirements of the AFDX protocol.
 * @param source Sender of the token.
 * @param receiver The receiver to send to.
 * @param token The token to send.
 * @exception IllegalActionException If the refiring request fails.
 */
@Override public void sendToken(Receiver source,Receiver receiver,Token token) throws IllegalActionException {
  Time currentTime=getDirector().getModelTime();
  Time lastTimeStamp=null;
  boolean multicast=false;
  IOPort receiverContainer=receiver.getContainer();
  Actor emitterSource=((IntermediateReceiver)source).source;
  System.out.println("String_Node_Str" + token.toString() + "String_Node_Str"+ receiver);
  System.out.println("String_Node_Str" + _portToVirtualLinks.toString());
  AFDXVlink vl=_portToVirtualLinks.get(receiverContainer);
  vl.setSource(emitterSource);
  if (!_lastEmissionTable.containsKey(vl.getName())) {
    _lastEmissionTable.put(vl.getName(),new Time(getDirector(),currentTime.getDoubleValue()));
  }
  if (!_virtualLinkTable.containsKey(vl.getName())) {
    _virtualLinkTable.put(vl.getName(),vl);
  }
  if (!_afdxSchedMuxsQueue.containsKey(vl.getSchedulerMux())) {
    _afdxSchedMuxsQueue.put(vl.getSchedulerMux(),new LinkedList<TimedEvent>());
  }
  if (!_afdxVLinksQueue.containsKey(vl.getName())) {
    _afdxVLinksQueue.put(vl.getName(),new LinkedList());
  }
  if (_afdxVLinksQueue.get(vl.getName()).size() > 0) {
    lastTimeStamp=_afdxVLinksQueue.get(vl.getName()).getLast().timeStamp;
    Object[] output=(Object[])_afdxVLinksQueue.get(vl.getName()).getLast().contents;
    if (((AFDXVlink)output[2]).getSource().equals(((IntermediateReceiver)source).source) && ((Time)output[3]).compareTo(currentTime) == 0) {
      multicast=true;
    }
  }
 else {
    lastTimeStamp=_lastEmissionTable.get(vl.getName());
  }
  if (multicast) {
    _lastEmissionTable.put(vl.getName(),lastTimeStamp);
    _afdxVLinksQueue.get(vl.getName()).add(new TimedEvent(lastTimeStamp,new Object[]{receiver,token,vl,currentTime}));
    multicast=false;
  }
 else {
    if (lastTimeStamp.compareTo(currentTime) == 0 && _afdxVLinksQueue.get(vl.getName()).size() < 1) {
      _delay=0.0;
    }
 else     if (lastTimeStamp.add(vl.getBag()).compareTo(currentTime) < 0) {
      _delay=0.0;
    }
 else     if (lastTimeStamp.add(vl.getBag()).compareTo(currentTime) == 0) {
      _delay=0.0;
    }
 else     if (lastTimeStamp.add(vl.getBag()).compareTo(currentTime) > 0) {
      _delay=lastTimeStamp.add(vl.getBag()).subtract(currentTime).getDoubleValue();
    }
    _lastEmissionTable.put(vl.getName(),currentTime.add(_delay));
    _afdxVLinksQueue.get(vl.getName()).add(new TimedEvent(currentTime.add(_delay),new Object[]{receiver,token,vl,currentTime}));
  }
  _tokenCount++;
  _scheduleRefire();
}