class KernelStateOperating extends KernelStateOnline {

  @Override
  @SuppressWarnings("deprecation")
  public void initialize() {
    if (initialized) {
      LOG.debug("Already initialized.");
      return;
    }
    LOG.debug("Initializing operating state...");

    // Reset vehicle states to ensure vehicles are not dispatchable initially.
    for (Vehicle curVehicle : getTCSObjects(Vehicle.class)) {
      setVehicleProcState(curVehicle.getReference(), Vehicle.ProcState.UNAVAILABLE);
      vehicleService.updateVehicleIntegrationLevel(curVehicle.getReference(),
                                                   Vehicle.IntegrationLevel.TO_BE_RESPECTED);
      setVehicleState(curVehicle.getReference(), Vehicle.State.UNKNOWN);
      setVehicleTransportOrder(curVehicle.getReference(), null);
      setVehicleOrderSequence(curVehicle.getReference(), null);
    }

    LOG.debug("Initializing scheduler '{}'...", scheduler);
    scheduler.initialize();
    LOG.debug("Initializing router '{}'...", router);
    router.initialize();
    LOG.debug("Initializing dispatcher '{}'...", dispatcher);
    dispatcher.initialize();
    LOG.debug("Initializing recovery evaluator '{}'...", recoveryEvaluator);
    recoveryEvaluator.initialize();
    LOG.debug("Initializing vehicle controller pool '{}'...", vehicleControllerPool);
    vehicleControllerPool.initialize();
    LOG.debug("Initializing attachment manager '{}'...", attachmentManager);
    attachmentManager.initialize();
    LOG.debug("Initializing script file manager '{}'...", scriptFileManager);
    scriptFileManager.initialize();

    // Start a task for cleaning up old orders periodically.
    cleanerTaskFuture = kernelExecutor.scheduleAtFixedRate(orderCleanerTask,
                                                           orderCleanerTask.getSweepInterval(),
                                                           orderCleanerTask.getSweepInterval(),
                                                           TimeUnit.MILLISECONDS);

    // Start kernel extensions.
    for (KernelExtension extension : extensions) {
      LOG.debug("Initializing kernel extension '{}'...", extension);
      extension.initialize();
    }
    LOG.debug("Finished initializing kernel extensions.");

    initialized = true;

    LOG.debug("Operating state initialized.");
  }

  @Inject @SuppressWarnings("deprecation")  KernelStateOperating(@GlobalKernelSync Object globalSyncObject,
                       TCSObjectPool objectPool,
                       Model model,
                       TransportOrderPool orderPool,
                       NotificationBuffer messageBuffer,
                       ModelPersister modelPersister,
                       KernelApplicationConfiguration configuration,
                       org.opentcs.components.kernel.RecoveryEvaluator recoveryEvaluator,
                       Router router,
                       Scheduler scheduler,
                       Dispatcher dispatcher,
                       LocalVehicleControllerPool controllerPool,
                       ScriptFileManager scriptFileManager,
                       @KernelExecutor ScheduledExecutorService kernelExecutor,
                       OrderCleanerTask orderCleanerTask,
                       @ActiveInOperatingMode Set<KernelExtension> extensions,
                       AttachmentManager attachmentManager,
                       VehicleService vehicleService);

}