Package org.opentcs.drivers.vehicle
Class MovementCommand
java.lang.Object
org.opentcs.drivers.vehicle.MovementCommand
A command for moving a step.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
A constant indicating the vehicle should basically just move to a point without a location associated to it.static final String
A constant indicating there is no operation to be executed after moving.static final String
A constant for parking the vehicle. -
Constructor Summary
ConstructorsConstructorDescriptionMovementCommand
(TransportOrder transportOrder, DriveOrder driveOrder, Route.Step step, String operation, Location opLocation, boolean finalMovement, Location finalDestinationLocation, Point finalDestination, String finalOperation, Map<String, String> properties) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
equalsInMovement
(MovementCommand command) Compares the given movement command to this movement command, ignoring rerouting-related properties.Returns the drive order this movement belongs to.Returns the final destination of the drive order this MovementCommand was created for.Returns the destination location of the whole drive order.Returns the operation to be executed at the final destination position.Returns the operation to be executed after moving.Returns the location at which the operation is to be executed.Returns the properties of the order this command is part of.getStep()
Returns the step describing the movement.Returns the transport order this movement belongs to.boolean
Indicates whether an operation is to be executed in addition to moving or not.int
hashCode()
boolean
Indicates whether this movement is the final one in the driver order it belongs to.toString()
withDriveOrder
(DriveOrder driveOrder) Creates a copy of this object, with the given drive order.withFinalDestination
(Point finalDestination) Creates a copy of this object, with the given final destination.withFinalDestinationLocation
(Location finalDestinationLocation) Creates a copy of this object, with the given final destination location.withFinalMovement
(boolean finalMovement) Creates a copy of this object, with the given final movement flag.withFinalOperation
(String finalOperation) Creates a copy of this object, with the given final operation.withOperation
(String operation) Creates a copy of this object, with the given operation.withOpLocation
(Location opLocation) Creates a copy of this object, with the given location at which the operation is to be executed.withProperties
(Map<String, String> properties) Creates a copy of this object, with the given properties.withStep
(Route.Step step) Creates a copy of this object, with the given step.withTransportOrder
(TransportOrder transportOrder) Creates a copy of this object, with the given transport order.
-
Field Details
-
NO_OPERATION
A constant indicating there is no operation to be executed after moving.- See Also:
-
MOVE_OPERATION
A constant indicating the vehicle should basically just move to a point without a location associated to it.- See Also:
-
PARK_OPERATION
A constant for parking the vehicle. (Again, basically doing nothing at the destination.)- See Also:
-
-
Constructor Details
-
MovementCommand
public MovementCommand(@Nonnull TransportOrder transportOrder, @Nonnull DriveOrder driveOrder, @Nonnull Route.Step step, @Nonnull String operation, @Nullable Location opLocation, boolean finalMovement, @Nullable Location finalDestinationLocation, @Nonnull Point finalDestination, @Nonnull String finalOperation, @Nonnull Map<String, String> properties) Creates a new instance.- Parameters:
transportOrder
- The transport order this movement belongs to.driveOrder
- The drive order this movement belongs to.step
- The step describing the movement.operation
- The operation to be executed after moving.opLocation
- The location at which the operation is to be executed. May benull
if the movement command's operation is considred an empty operation (i.e. isNO_OPERATION
,MOVE_OPERATION
orPARK_OPERATION
).finalMovement
- Indicates whether this movement is the final one in the drive order it belongs to.finalDestinationLocation
- The destination location of the whole drive order.finalDestination
- The destination position of the whole drive order.finalOperation
- The operation to be executed at the destination position.properties
- Properties of the order this command is part of.
-
-
Method Details
-
getTransportOrder
Returns the transport order this movement belongs to.- Returns:
- The transport order this movement belongs to.
-
withTransportOrder
Creates a copy of this object, with the given transport order.- Parameters:
transportOrder
- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
getDriveOrder
Returns the drive order this movement belongs to.- Returns:
- The drive order this movement belongs to.
-
withDriveOrder
Creates a copy of this object, with the given drive order.- Parameters:
driveOrder
- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
getStep
Returns the step describing the movement.- Returns:
- The step describing the movement.
-
withStep
Creates a copy of this object, with the given step.- Parameters:
step
- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
getOperation
Returns the operation to be executed after moving.- Returns:
- The operation to be executed after moving.
-
withOperation
Creates a copy of this object, with the given operation.- Parameters:
operation
- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
hasEmptyOperation
public boolean hasEmptyOperation()Indicates whether an operation is to be executed in addition to moving or not.- Returns:
true
if, and only if, no operation is to be executed.
-
getOpLocation
Returns the location at which the operation is to be executed.May be
null
if the movement command's operation is considred an empty operation (i.e. isNO_OPERATION
,MOVE_OPERATION
orPARK_OPERATION
).- Returns:
- The location at which the operation is to be executed.
-
withOpLocation
Creates a copy of this object, with the given location at which the operation is to be executed.May be
null
if the movement command's operation is considred an empty operation (i.e. isNO_OPERATION
,MOVE_OPERATION
orPARK_OPERATION
).- Parameters:
opLocation
- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
isFinalMovement
public boolean isFinalMovement()Indicates whether this movement is the final one in the driver order it belongs to.- Returns:
true
if, and only if, this movement is the final one.
-
withFinalMovement
Creates a copy of this object, with the given final movement flag.- Parameters:
finalMovement
- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
getFinalDestination
Returns the final destination of the drive order this MovementCommand was created for.- Returns:
- The final destination of the drive order this MovementCommand was created for.
-
withFinalDestination
Creates a copy of this object, with the given final destination.- Parameters:
finalDestination
- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
getFinalDestinationLocation
Returns the destination location of the whole drive order.- Returns:
- The destination location of the whole drive order.
-
withFinalDestinationLocation
Creates a copy of this object, with the given final destination location.- Parameters:
finalDestinationLocation
- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
getFinalOperation
Returns the operation to be executed at the final destination position.- Returns:
- The operation to be executed at the final destination position.
-
withFinalOperation
Creates a copy of this object, with the given final operation.- Parameters:
finalOperation
- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
getProperties
Returns the properties of the order this command is part of.- Returns:
- The properties of the order this command is part of.
-
withProperties
Creates a copy of this object, with the given properties.- Parameters:
properties
- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
equals
-
equalsInMovement
Compares the given movement command to this movement command, ignoring rerouting-related properties.- Parameters:
command
- The movement command to compare to.- Returns:
true
, if the given movement command is equal to this movement command (ignoring rerouting-related properties), otherwisefalse
.
-
hashCode
public int hashCode() -
toString
-