private void handleTimeout(Event event) {
    Tx tx = getSystem().getTxs().get(event.getTxIndex());

    if (!tx.isTransmiting()) {
      tx.handleTimeOutEvent();
      newTxPacketHeadsToRouter(tx);
    } else tx.handleTimeOutEvent();
  }
 private void handleTxPacketHeadsToRouter(Event event) {
   Tx tx = getSystem().getTxs().get(event.getTxIndex());
   if (tx.getNextPacketToSend() < tx.getOldestNotReceivedPacket() + tx.getCongestionWindow())
     newTxPacketHeadsToRouter(tx);
   else tx.setTransmiting(false);
 }