code: @Override
    public List<SimulatorEvent> accept(SimulatorEvent event) {
      if (LOG.isDebugEnabled()) {
        LOG.debug("Accepted event " + event);
      }
  
      if (event instanceof HeartbeatEvent) {
        return processHeartbeatEvent((HeartbeatEvent)event);
      } else if (event instanceof TaskAttemptCompletionEvent) {
        return processTaskAttemptCompletionEvent((TaskAttemptCompletionEvent)
                                                 event);
      } else {
        throw new IllegalArgumentException("Unhandled event "+event);
      }
    }
docs: Processes a simulation event.
  
  @param event the event to process, should be an instance of HeartbeatEvent
  or TaskAttemptCompletionEvent
  @return the list of new events generated in response