Schnittstelle VehicleController

Alle Superschnittstellen:
Lifecycle

public interface VehicleController extends Lifecycle
Provides high-level methods for the kernel to control a vehicle.
  • Methodendetails

    • setTransportOrder

      void setTransportOrder(@Nonnull TransportOrder newOrder) throws IllegalArgumentException
      Sets/Updates the current transport order for the vehicle associated with this controller.

      The controller is expected to process the transport order's current drive order. Once processing of this drive order is finished, it sets the vehicle's processing state to Vehicle.ProcState.AWAITING_ORDER to signal this. This method will then be called for either the next drive order in the same transport order or a new transport order.

      This method may also be called again for the same/current drive order in case any future part of the route to be taken for the transport order has changed. In case of such an update, the continuity of the transport order's route is guaranteed, which means that the previously given route and the one given in newOrder match up to the last point already sent to the vehicle associated with this controller. Beyond that point the routes may diverge.

      Parameter:
      newOrder - The new or updated transport order.
      Löst aus:
      IllegalArgumentException - If newOrder cannot be processed for some reason, e.g. because it has already been partly processed and the route's continuity is not given, the vehicle's current position is unknown or the resources for the vehicle's current position may not be allocated (in case of forced rerouting).
    • abortTransportOrder

      void abortTransportOrder(boolean immediate)
      Notifies the controller that the current transport order is to be aborted. After receiving this notification, the controller should not send any further movement commands to the vehicle.
      Parameter:
      immediate - If true, immediately reset the current transport order for the vehicle associated with this controller, clears the vehicle's command queue implicitly and frees all resources reserved for the removed commands/movements. (Note that this is unsafe, as the vehicle might be moving and clearing the command queue might overlap with the vehicle's movement/progress.)
    • canProcess

      @Nonnull ExplainedBoolean canProcess(@Nonnull TransportOrder order)
      Checks if the vehicle would be able to process the given transport order, taking into account its current state.
      Parameter:
      order - The transport order to be checked.
      Gibt zurück:
      An ExplainedBoolean indicating whether the vehicle would be able to process given order.
    • onVehiclePaused

      void onVehiclePaused(boolean paused)
      Notifies the implementation that the vehicle's paused state in the kernel has changed. If pausing between points in the plant model is supported by the vehicle, the communication adapter may want to inform the vehicle about this change of state.
      Parameter:
      paused - The vehicle's new paused state.
    • sendCommAdapterMessage

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

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

      @Nonnull Queue<MovementCommand> getCommandsSent()
      Returns a list of MovementCommands that have been sent to the communication adapter.
      Gibt zurück:
      A list of MovementCommands that have been sent to the communication adapter.
    • getInteractionsPendingCommand

      @Nonnull Optional<MovementCommand> getInteractionsPendingCommand()
      Returns the command for which the execution of peripheral operations must be completed before it can be sent to the communication adapter. For this command, allocated resources have already been accepted.
      Gibt zurück:
      The command for which the execution of peripheral operations is pending or Optional.empty() if there's no such command.
    • mayAllocateNow

      boolean mayAllocateNow(@Nonnull Set<TCSResource<?>> resources)
      Checks if the given set of resources are safe to be allocated immediately by this controller.
      Parameter:
      resources - The requested resources.
      Gibt zurück:
      true if the given resources are safe to be allocated by this controller, otherwise false.