Interface VehicleController

All Superinterfaces:
Lifecycle, Scheduler.Client

public interface VehicleController
extends Lifecycle, Scheduler.Client
Provides high-level methods for the system to control a vehicle.
  • Method Details

    • setDriveOrder

      void setDriveOrder​(@Nonnull DriveOrder newOrder, @Nonnull java.util.Map<java.lang.String,​java.lang.String> orderProperties) throws java.lang.IllegalStateException
      Sets the current drive order for the vehicle associated with this controller.
      Parameters:
      newOrder - The new drive order.
      orderProperties - Properties of the transport order the new drive order is part of.
      Throws:
      java.lang.IllegalStateException - If this controller already has a drive order.
    • updateDriveOrder

      void updateDriveOrder​(@Nonnull DriveOrder newOrder, @Nonnull java.util.Map<java.lang.String,​java.lang.String> orderProperties) throws java.lang.IllegalStateException
      Updates the current drive order for the vehicle associated with this controller.

      An update is only allowed, if the continuity of the current drive order is guaranteed. The continuity of the current drive order is guaranteed, if the routes of both the current drive order and the newOrder match to the point where the vehicle associated with this controller is currently reported at. Beyond that point the routes may diverge.

      Parameters:
      newOrder - The new drive order.
      orderProperties - Properties of the transport order the new drive order is part of.
      Throws:
      java.lang.IllegalStateException - If the newOrder would not guarantee the current drive order's continuity.
    • clearDriveOrder

      void clearDriveOrder()
      Resets the current drive order for the vehicle associated with this controller.
    • abortDriveOrder

      void abortDriveOrder()
      Notifies the controller that the current drive order is to be aborted. After receiving this notification, the controller should not send any further movement commands to the vehicle.
    • clearCommandQueue

      void clearCommandQueue()
      Clears the associated vehicle's command queue and frees all resources reserved for the removed commands/movements.
    • canProcess

      @Nonnull ExplainedBoolean canProcess​(@Nonnull java.util.List<java.lang.String> operations)
      Checks if the vehicle would be able to process the given sequence of operations, taking into account its current state.
      Parameters:
      operations - A sequence of operations that might appear in future commands.
      Returns:
      A Processability telling if the vehicle would be able to process every single operation in the list (in the given order).
    • sendCommAdapterMessage

      void sendCommAdapterMessage​(@Nullable java.lang.Object message)
      Delivers a generic message to the communication adapter.
      Parameters:
      message - The message to be delivered.
    • sendCommAdapterCommand

      void sendCommAdapterCommand​(@Nonnull AdapterCommand command)
      Sends a AdapterCommand to the communication adapter.
      Parameters:
      command - The adapter command to be sent.
    • getCommandsSent

      @Nonnull java.util.Queue<MovementCommand> getCommandsSent()
      Returns a list of MovementCommands that have been sent to the communication adapter.
      Returns:
      A list of MovementCommands that have been sent to the communication adapter.