Package org.opentcs.data.model
Class Vehicle
- All Implemented Interfaces:
Serializable
Describes a vehicle's current state.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classContains information regarding the energy level threshold values of a vehicle.static enumA vehicle's state of integration into the system.static classContains information regarding the graphical representation of a vehicle.static enumThe elements of this enumeration represent the possible orientations of a vehicle.static enumA vehicle's processing state as seen by the dispatcher.static enumThe elements of this enumeration describe the various possible states of a vehicle. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe key for a property to store the class name of the preferred communication adapter (factory) for this vehicle. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the set of order types this vehicle is allowed to process.List<Set<TCSResourceReference<?>>> Returns the resources this vehicle has allocated.Deprecated.Returns the vehicle's current bounding box (in mm).List<Set<TCSResourceReference<?>>> Returns the resources this vehicle has claimed for future allocation.Returns a reference to the point this vehicle currently occupies.intReturns this vehicle's remaining energy (in percent of the maximum).intDeprecated.UsegetEnergyLevelThresholdSet()instead.intDeprecated.UsegetEnergyLevelThresholdSet()instead.intDeprecated.UsegetEnergyLevelThresholdSet()instead.intDeprecated.UsegetEnergyLevelThresholdSet()instead.Returns this vehicle's energy level threshold set.Returns the key for selecting the envelope to be used for resources the vehicle occupies.Returns this vehicle's integration level.Returns the information regarding the graphical representation of this vehicle.intDeprecated.UsegetBoundingBox()instead.Returns the current (state of the) load handling devices of this vehicle.intReturns this vehicle's maximum reverse velocity (in mm/s).intReturns this vehicle's maximum velocity (in mm/s).Deprecated.Extract a vehicle's next position fromgetAllocatedResources()instead.Returns a reference to the order sequence this vehicle is currently processing.doubleDeprecated.UsegetPose()instead.getPose()Returns the vehicle's pose containing the precise position and orientation angle.Deprecated.UsegetPose()instead.Returns this vehicle's current processing state.Returns the time at which the vehicle has entered its current processing state.Returns the operation that the vehicle's current communication adapter accepts as a command to recharge the vehicle.getState()Returns this vehicle's current state.Returns the time at which the vehicle has entered its current state.Returns a reference to the transport order this vehicle is currently processing.booleanhasProcState(Vehicle.ProcState otherState) Checks if this vehicle's current processing state is equal to the given one.booleanhasState(Vehicle.State otherState) Checks if this vehicle's current state is equal to the given one.booleanChecks whether the vehicle's energy level is critical.booleanChecks whether the vehicle's energy level is degraded (not good any more).booleanChecks whether the vehicle's energy level is fully recharged.booleanChecks whether the vehicle's energy level is good.booleanChecks whether the vehicle's energy level is sufficiently recharged.booleanisPaused()Indicates whether this vehicle is paused.booleanChecks if this vehicle is currently processing any transport order.toString()withAcceptableOrderTypes(Set<AcceptableOrderType> acceptableOrderTypes) Creates a copy of this object, with the given set of acceptable order types.withAllocatedResources(List<Set<TCSResourceReference<?>>> allocatedResources) Creates a copy of this object, with the given allocated resources.withAllowedOrderTypes(Set<String> allowedOrderTypes) Deprecated.UsewithAcceptableOrderTypes(Set)instead.withBoundingBox(BoundingBox boundingBox) Creates a copy of this object, with the given bounding box (in mm).withClaimedResources(List<Set<TCSResourceReference<?>>> claimedResources) Creates a copy of this object, with the given claimed resources.withCurrentPosition(TCSObjectReference<Point> currentPosition) Creates a copy of this object, with the given current position.withEnergyLevel(int energyLevel) Creates a copy of this object, with the given energy level.withEnergyLevelCritical(int energyLevelCritical) Deprecated.UsewithEnergyLevelThresholdSet(EnergyLevelThresholdSet)instead.withEnergyLevelFullyRecharged(int energyLevelFullyRecharged) Deprecated.UsewithEnergyLevelThresholdSet(EnergyLevelThresholdSet)instead.withEnergyLevelGood(int energyLevelGood) Deprecated.UsewithEnergyLevelThresholdSet(EnergyLevelThresholdSet)instead.withEnergyLevelSufficientlyRecharged(int energyLevelSufficientlyRecharged) Deprecated.UsewithEnergyLevelThresholdSet(EnergyLevelThresholdSet)instead.withEnergyLevelThresholdSet(Vehicle.EnergyLevelThresholdSet energyLevelThresholdSet) Creates a copy of this object, with the given EnergyLevelThresholdSet.withEnvelopeKey(String envelopeKey) Creates a copy of this object, with the given envelope key.withHistory(ObjectHistory history) Creates a copy of this object, with the given history.Creates a copy of this object, with the given history entry integrated.withIntegrationLevel(Vehicle.IntegrationLevel integrationLevel) Creates a copy of this object, with the given integration level.withLayout(Vehicle.Layout layout) Creates a copy of this object, with the given layout.withLength(int length) Deprecated.UsewithBoundingBox(BoundingBox)instead.withLoadHandlingDevices(List<LoadHandlingDevice> loadHandlingDevices) Creates a copy of this object, with the given load handling devices.withMaxReverseVelocity(int maxReverseVelocity) Creates a copy of this object, with the given maximum reverse velocity.withMaxVelocity(int maxVelocity) Creates a copy of this object, with the given maximum velocity.withNextPosition(TCSObjectReference<Point> nextPosition) Deprecated.Will be removed without replacement.withOrderSequence(TCSObjectReference<OrderSequence> orderSequence) Creates a copy of this object, with the given order sequence.withOrientationAngle(double orientationAngle) Deprecated.UsewithPose(Pose)instead.withPaused(boolean paused) Creates a copy of this object, with the given paused state.Creates a copy of this object, with the given pose.withPrecisePosition(Triple precisePosition) Deprecated.UsewithPose(Pose)instead.withProcState(Vehicle.ProcState procState) Creates a copy of this object, with the given processing state.withProperties(Map<String, String> properties) Creates a copy of this object, with the given properties.withProperty(String key, String value) Creates a copy of this object, with the given property integrated.withRechargeOperation(String rechargeOperation) Creates a copy of this object, with the given recharge operation.withState(Vehicle.State state) Creates a copy of this object, with the given state.withTransportOrder(TCSObjectReference<TransportOrder> transportOrder) Creates a copy of this object, with the given transport order.Methods inherited from class org.opentcs.data.TCSObject
equals, getHistory, getName, getProperties, getProperty, getReference, hashCode, listWithoutNullValues, mapWithoutNullValues, propertiesWith, setWithoutNullValues
-
Field Details
-
PREFERRED_ADAPTER
The key for a property to store the class name of the preferred communication adapter (factory) for this vehicle.- See Also:
-
-
Constructor Details
-
Vehicle
Creates a new vehicle.- Parameters:
name- The new vehicle's name.
-
-
Method Details
-
withProperty
Description copied from class:TCSObjectCreates a copy of this object, with the given property integrated.- Specified by:
withPropertyin classTCSObject<Vehicle>- Parameters:
key- The key of the property to be changed.value- The new value of the property, ornull, if the property is to be removed.- Returns:
- A copy of this object, with the given property integrated.
-
withProperties
Description copied from class:TCSObjectCreates a copy of this object, with the given properties.- Specified by:
withPropertiesin classTCSObject<Vehicle>- Parameters:
properties- The properties.- Returns:
- A copy of this object, with the given properties.
-
withHistoryEntry
Description copied from class:TCSObjectCreates a copy of this object, with the given history entry integrated.- Specified by:
withHistoryEntryin classTCSObject<Vehicle>- Parameters:
entry- The history entry to be integrated.- Returns:
- A copy of this object, with the given history entry integrated.
-
withHistory
Description copied from class:TCSObjectCreates a copy of this object, with the given history.- Specified by:
withHistoryin classTCSObject<Vehicle>- Parameters:
history- The history.- Returns:
- A copy of this object, with the given history.
-
getEnergyLevel
public int getEnergyLevel()Returns this vehicle's remaining energy (in percent of the maximum).- Returns:
- This vehicle's remaining energy.
-
withEnergyLevel
Creates a copy of this object, with the given energy level.- Parameters:
energyLevel- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
isEnergyLevelCritical
public boolean isEnergyLevelCritical()Checks whether the vehicle's energy level is critical.- Returns:
trueif, and only if, the vehicle's energy level is critical.
-
isEnergyLevelDegraded
public boolean isEnergyLevelDegraded()Checks whether the vehicle's energy level is degraded (not good any more).- Returns:
trueif, and only if, the vehicle's energy level is degraded.
-
isEnergyLevelGood
public boolean isEnergyLevelGood()Checks whether the vehicle's energy level is good.- Returns:
trueif, and only if, the vehicle's energy level is good.
-
isEnergyLevelFullyRecharged
public boolean isEnergyLevelFullyRecharged()Checks whether the vehicle's energy level is fully recharged.- Returns:
trueif, and only if, the vehicle's energy level is fully recharged.
-
isEnergyLevelSufficientlyRecharged
public boolean isEnergyLevelSufficientlyRecharged()Checks whether the vehicle's energy level is sufficiently recharged.- Returns:
trueif, and only if, the vehicle's energy level is sufficiently recharged.
-
getEnergyLevelCritical
@Deprecated @ScheduledApiChange(when="7.0", details="Will be removed.") public int getEnergyLevelCritical()Deprecated.UsegetEnergyLevelThresholdSet()instead.Returns this vehicle's critical energy level (in percent of the maximum). The critical energy level is the one at/below which the vehicle should be recharged.- Returns:
- This vehicle's critical energy level.
-
withEnergyLevelCritical
@Deprecated @ScheduledApiChange(when="7.0", details="Will be removed.") public Vehicle withEnergyLevelCritical(int energyLevelCritical) Deprecated.UsewithEnergyLevelThresholdSet(EnergyLevelThresholdSet)instead.Creates a copy of this object, with the given critical energy level.- Parameters:
energyLevelCritical- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
getEnergyLevelGood
@Deprecated @ScheduledApiChange(when="7.0", details="Will be removed.") public int getEnergyLevelGood()Deprecated.UsegetEnergyLevelThresholdSet()instead.Returns this vehicle's good energy level (in percent of the maximum). The good energy level is the one at/above which the vehicle can be dispatched again when charging.- Returns:
- This vehicle's good energy level.
-
withEnergyLevelGood
@Deprecated @ScheduledApiChange(when="7.0", details="Will be removed.") public Vehicle withEnergyLevelGood(int energyLevelGood) Deprecated.UsewithEnergyLevelThresholdSet(EnergyLevelThresholdSet)instead.Creates a copy of this object, with the given good energy level.- Parameters:
energyLevelGood- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
getEnergyLevelFullyRecharged
@Deprecated @ScheduledApiChange(when="7.0", details="Will be removed.") public int getEnergyLevelFullyRecharged()Deprecated.UsegetEnergyLevelThresholdSet()instead.Returns this vehicle's energy level for being fully recharged (in percent of the maximum).- Returns:
- This vehicle's fully recharged threshold.
-
withEnergyLevelFullyRecharged
@Deprecated @ScheduledApiChange(when="7.0", details="Will be removed.") public Vehicle withEnergyLevelFullyRecharged(int energyLevelFullyRecharged) Deprecated.UsewithEnergyLevelThresholdSet(EnergyLevelThresholdSet)instead.Creates a copy of this object, with the given fully recharged energy level.- Parameters:
energyLevelFullyRecharged- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
getEnergyLevelSufficientlyRecharged
@Deprecated @ScheduledApiChange(when="7.0", details="Will be removed.") public int getEnergyLevelSufficientlyRecharged()Deprecated.UsegetEnergyLevelThresholdSet()instead.Returns this vehicle's energy level for being sufficiently recharged (in percent of the maximum).- Returns:
- This vehicle's sufficiently recharged energy level.
-
withEnergyLevelSufficientlyRecharged
@Deprecated @ScheduledApiChange(when="7.0", details="Will be removed.") public Vehicle withEnergyLevelSufficientlyRecharged(int energyLevelSufficientlyRecharged) Deprecated.UsewithEnergyLevelThresholdSet(EnergyLevelThresholdSet)instead.Creates a copy of this object, with the given sufficiently recharged energy level.- Parameters:
energyLevelSufficientlyRecharged- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
getEnergyLevelThresholdSet
Returns this vehicle's energy level threshold set.- Returns:
- This vehicle's energy level threshold set.
-
withEnergyLevelThresholdSet
Creates a copy of this object, with the given EnergyLevelThresholdSet.- Parameters:
energyLevelThresholdSet- The new EnergyLevelThresholdSet.- Returns:
- A copy of this object, differing in the given value.
-
getRechargeOperation
Returns the operation that the vehicle's current communication adapter accepts as a command to recharge the vehicle.- Returns:
- The operation that the vehicle's current communication adapter accepts as a command to recharge the vehicle.
-
withRechargeOperation
Creates a copy of this object, with the given recharge operation.- Parameters:
rechargeOperation- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
getLoadHandlingDevices
Returns the current (state of the) load handling devices of this vehicle.- Returns:
- The current (state of the) load handling devices of this vehicle.
-
withLoadHandlingDevices
Creates a copy of this object, with the given load handling devices.- Parameters:
loadHandlingDevices- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
getMaxVelocity
public int getMaxVelocity()Returns this vehicle's maximum velocity (in mm/s).- Returns:
- This vehicle's maximum velocity (in mm/s).
-
withMaxVelocity
Creates a copy of this object, with the given maximum velocity.- Parameters:
maxVelocity- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
getMaxReverseVelocity
public int getMaxReverseVelocity()Returns this vehicle's maximum reverse velocity (in mm/s).- Returns:
- This vehicle's maximum reverse velocity (in mm/s).
-
withMaxReverseVelocity
Creates a copy of this object, with the given maximum reverse velocity.- Parameters:
maxReverseVelocity- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
getState
Returns this vehicle's current state.- Returns:
- This vehicle's current state.
-
getStateTimestamp
Returns the time at which the vehicle has entered its current state.- Returns:
- The time at which the vehicle has entered its current state.
-
hasState
Checks if this vehicle's current state is equal to the given one.- Parameters:
otherState- The state to compare to this vehicle's one.- Returns:
trueif, and only if, the given state is equal to this vehicle's one.
-
withState
Creates a copy of this object, with the given state.- Parameters:
state- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
getProcState
Returns this vehicle's current processing state.- Returns:
- This vehicle's current processing state.
-
getProcStateTimestamp
Returns the time at which the vehicle has entered its current processing state.- Returns:
- The time at which the vehicle has entered its current processing state.
-
getIntegrationLevel
Returns this vehicle's integration level.- Returns:
- This vehicle's integration level.
-
withIntegrationLevel
Creates a copy of this object, with the given integration level.- Parameters:
integrationLevel- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
isPaused
public boolean isPaused()Indicates whether this vehicle is paused.- Returns:
- Whether this vehicle is paused.
-
withPaused
Creates a copy of this object, with the given paused state.- Parameters:
paused- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
hasProcState
Checks if this vehicle's current processing state is equal to the given one.- Parameters:
otherState- The state to compare to this vehicle's one.- Returns:
trueif, and only if, the given state is equal to this vehicle's one.
-
withProcState
Creates a copy of this object, with the given processing state.- Parameters:
procState- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
getBoundingBox
Returns the vehicle's current bounding box (in mm).The bounding box is oriented so that its longitudinal axis runs parallel to the longitudinal axis of the vehicle. For the reference point offset, positive x values indicate an offset in the forward direction of the vehicle, positive y values an offset towards the left-hand side.
- Returns:
- The vehicle's current bounding box (in mm).
-
withBoundingBox
Creates a copy of this object, with the given bounding box (in mm).The bounding box is oriented so that its longitudinal axis runs parallel to the longitudinal axis of the vehicle. For the reference point offset, positive x values indicate an offset in the forward direction of the vehicle, positive y values an offset towards the left-hand side.
- Parameters:
boundingBox- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
getLength
Deprecated.UsegetBoundingBox()instead.Returns this vehicle's current length.- Returns:
- this vehicle's current length.
-
withLength
@Deprecated @ScheduledApiChange(when="7.0", details="Will be removed.") public Vehicle withLength(int length) Deprecated.UsewithBoundingBox(BoundingBox)instead.Creates a copy of this object, with the given length.- Parameters:
length- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
getTransportOrder
Returns a reference to the transport order this vehicle is currently processing.- Returns:
- A reference to the transport order this vehicle is currently
processing, or
null, if it is not processing any transport order at the moment.
-
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.
-
getOrderSequence
Returns a reference to the order sequence this vehicle is currently processing.- Returns:
- A reference to the order sequence this vehicle is currently
processing, or
null, if it is not processing any order sequence at the moment.
-
withOrderSequence
Creates a copy of this object, with the given order sequence.- Parameters:
orderSequence- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
getAllowedOrderTypes
@Deprecated @ScheduledApiChange(when="7.0", details="Will be removed") public Set<String> getAllowedOrderTypes()Deprecated.UsegetAcceptableOrderTypes()instead.Returns the set of order types this vehicle is allowed to process.- Returns:
- The set of order types this vehicle is allowed to process.
-
withAllowedOrderTypes
@Deprecated @ScheduledApiChange(when="7.0", details="Will be removed.") public Vehicle withAllowedOrderTypes(Set<String> allowedOrderTypes) Deprecated.UsewithAcceptableOrderTypes(Set)instead.Creates a copy of this object, with the given set of allowed order types.- Parameters:
allowedOrderTypes- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
getAcceptableOrderTypes
Returns the set of order types this vehicle is allowed to process.- Returns:
- The set of order types this vehicle is allowed to process, and their priorities.
-
withAcceptableOrderTypes
Creates a copy of this object, with the given set of acceptable order types.- Parameters:
acceptableOrderTypes- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
getClaimedResources
Returns the resources this vehicle has claimed for future allocation.- Returns:
- The resources this vehicle has claimed for future allocation.
-
withClaimedResources
Creates a copy of this object, with the given claimed resources.- Parameters:
claimedResources- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
getAllocatedResources
Returns the resources this vehicle has allocated.- Returns:
- The resources this vehicle has allocated.
-
withAllocatedResources
Creates a copy of this object, with the given allocated resources.- Parameters:
allocatedResources- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
getCurrentPosition
Returns a reference to the point this vehicle currently occupies.- Returns:
- A reference to the point this vehicle currently occupies, or
null, if this vehicle's position is unknown or the vehicle is currently not in the system.
-
withCurrentPosition
Creates a copy of this object, with the given current position.- Parameters:
currentPosition- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
getNextPosition
@Deprecated @ScheduledApiChange(when="7.0", details="Will be removed.") public TCSObjectReference<Point> getNextPosition()Deprecated.Extract a vehicle's next position fromgetAllocatedResources()instead. In this list, the next position is the one aftergetCurrentPosition().Returns a reference to the point this vehicle is expected to be seen at next.- Returns:
- A reference to the point this vehicle is expected to be seen at
next, or
null, if this vehicle's next position is unknown.
-
withNextPosition
@Deprecated @ScheduledApiChange(when="7.0", details="Will be removed") public Vehicle withNextPosition(TCSObjectReference<Point> nextPosition) Deprecated.Will be removed without replacement.Creates a copy of this object, with the given next position.- Parameters:
nextPosition- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
getPrecisePosition
@Deprecated @ScheduledApiChange(when="7.0", details="Will be removed.") public Triple getPrecisePosition()Deprecated.UsegetPose()instead.Returns the vehicle's position in world coordinates [mm], independent of logical positions/point names. May benullif the vehicle hasn't provided a precise position.- Returns:
- The vehicle's precise position in mm.
-
withPrecisePosition
@Deprecated @ScheduledApiChange(when="7.0", details="Will be removed.") public Vehicle withPrecisePosition(Triple precisePosition) Deprecated.UsewithPose(Pose)instead.Creates a copy of this object, with the given precise position.- Parameters:
precisePosition- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
getOrientationAngle
@Deprecated @ScheduledApiChange(when="7.0", details="Will be removed.") public double getOrientationAngle()Deprecated.UsegetPose()instead.Returns the vehicle's current orientation angle (-360..360). May beDouble.NaNif the vehicle hasn't provided an orientation angle.- Returns:
- The vehicle's current orientation angle.
-
withOrientationAngle
@Deprecated @ScheduledApiChange(when="7.0", details="Will be removed.") public Vehicle withOrientationAngle(double orientationAngle) Deprecated.UsewithPose(Pose)instead.Creates a copy of this object, with the given orientation angle.- Parameters:
orientationAngle- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
getPose
Returns the vehicle's pose containing the precise position and orientation angle.- Returns:
- The vehicle's pose.
-
withPose
Creates a copy of this object, with the given pose.- Parameters:
pose- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
getEnvelopeKey
@ScheduledApiChange(when="7.0", details="Envelope key will become non-null.") @Nullable public String getEnvelopeKey()Returns the key for selecting the envelope to be used for resources the vehicle occupies.- Returns:
- The key for selecting the envelope to be used for resources the vehicle occupies.
-
withEnvelopeKey
@ScheduledApiChange(when="7.0", details="Envelope key will become non-null.") public Vehicle withEnvelopeKey(@Nullable String envelopeKey) Creates a copy of this object, with the given envelope key.- Parameters:
envelopeKey- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
getLayout
Returns the information regarding the graphical representation of this vehicle.- Returns:
- The information regarding the graphical representation of this vehicle.
-
withLayout
Creates a copy of this object, with the given layout.- Parameters:
layout- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
isProcessingOrder
public boolean isProcessingOrder()Checks if this vehicle is currently processing any transport order.- Returns:
trueif, and only if, this vehicle is currently processing a transport order.
-
toString
-
getAcceptableOrderTypes()instead.