Package org.opentcs.data.order
Class OrderSequence
- All Implemented Interfaces:
Serializable
Describes a process spanning multiple
TransportOrders which are to be executed
subsequently by the same Vehicle.
The most important rules for order sequence processing are:
- Only transport orders that have not yet been activated may be added to an order sequence. Allowing them to be added at a later point of time would imply that, due to concurrency in the kernel, a transport order might happen to be dispatched at the same time or shortly after it is added to a sequence, regardless of if its predecessors in the sequence have already been finished or not.
- The intendedVehicle of a transport order being added to an order sequence must be
the same as that of the sequence itself.
If it is
nullin the sequence, a vehicle that will process all orders in the sequence will be chosen automatically once the first order in the sequence is dispatched. - If an order sequence is marked as complete and all transport orders belonging to it
have arrived in state
FINISHEDorFAILED, it will be marked as finished implicitly. - If a transport order belonging to an order sequence fails and the sequence's failureFatal flag is set, all subsequent orders in the sequence will automatically be considered (and marked as) failed, too, and the order sequence will implicitly be marked as complete (and finished).
- See Also:
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns this order sequence's creation time.intReturns the index of the order that was last finished in the sequence, or -1, if none was finished, yet.Returns the point of time at which this order sequence has been processed completely.Returns a reference to the vehicle that is intended to process this order sequence.Returns the next order in the sequence that hasn't been finished, yet.Returns the list of orders making up this sequence.Returns a reference to the vehicle currently processing this sequence.getType()Returns this order sequence's type.booleanIndicates whether this order sequence is complete and will not be extended by more orders.booleanIndicates whether the failure of a single order in this sequence implies that all subsequent orders in this sequence are to be considered failed, too.booleanIndicates whether this order sequence has been processed completely.toString()withComplete(boolean complete) Creates a copy of this object, with the given complete flag.withCreationTime(Instant creationTime) Creates a copy of this object, with the given creation time.withFailureFatal(boolean failureFatal) Creates a copy of this object, with the given failure-fatal flag.withFinished(boolean finished) Creates a copy of this object, with the given finished flag.withFinishedIndex(int finishedIndex) Creates a copy of this object, with the given finished index.withFinishedTime(Instant finishedTime) Creates a copy of this object, with the given finished time.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.withIntendedVehicle(TCSObjectReference<Vehicle> intendedVehicle) Creates a copy of this object, with the given intended vehicle.Creates a copy of this object, with the given order.withProcessingVehicle(TCSObjectReference<Vehicle> processingVehicle) Creates a copy of this object, with the given processing vehicle.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.Creates a copy of this object, with the given type.Methods inherited from class org.opentcs.data.TCSObject
equals, getHistory, getName, getProperties, getProperty, getReference, hashCode, listWithoutNullValues, mapWithoutNullValues, propertiesWith, setWithoutNullValues
-
Constructor Details
-
OrderSequence
Creates a new OrderSequence.- Parameters:
name- This sequence's name.
-
-
Method Details
-
withProperty
Description copied from class:TCSObjectCreates a copy of this object, with the given property integrated.- Specified by:
withPropertyin classTCSObject<OrderSequence>- 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<OrderSequence>- 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<OrderSequence>- 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<OrderSequence>- Parameters:
history- The history.- Returns:
- A copy of this object, with the given history.
-
getType
Returns this order sequence's type.- Returns:
- This order sequence's type.
-
withType
Creates a copy of this object, with the given type.- Parameters:
type- The type to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
getOrders
Returns the list of orders making up this sequence.- Returns:
- The list of orders making up this sequence.
-
withOrder
Creates a copy of this object, with the given order.- Parameters:
order- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
getCreationTime
Returns this order sequence's creation time.- Returns:
- This order sequence's creation time.
-
withCreationTime
Creates a copy of this object, with the given creation time.- Parameters:
creationTime- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
getNextUnfinishedOrder
Returns the next order in the sequence that hasn't been finished, yet.- Returns:
nullif this sequence has been finished already or currently doesn't have any unfinished orders, else the order after the one that was last finished.
-
getFinishedIndex
public int getFinishedIndex()Returns the index of the order that was last finished in the sequence, or -1, if none was finished, yet.- Returns:
- the index of the order that was last finished in the sequence.
-
withFinishedIndex
Creates a copy of this object, with the given finished index.- Parameters:
finishedIndex- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
isComplete
public boolean isComplete()Indicates whether this order sequence is complete and will not be extended by more orders.- Returns:
trueif, and only if, this order sequence is complete and will not be extended by more orders.
-
withComplete
Creates a copy of this object, with the given complete flag.- Parameters:
complete- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
isFinished
public boolean isFinished()Indicates whether this order sequence has been processed completely. (Note that processed completely does not necessarily mean finished successfully; it is possible that one or more transport orders belonging to this sequence have failed.)- Returns:
trueif, and only if, this order sequence has been processed completely.
-
withFinished
Creates a copy of this object, with the given finished flag.- Parameters:
finished- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
isFailureFatal
public boolean isFailureFatal()Indicates whether the failure of a single order in this sequence implies that all subsequent orders in this sequence are to be considered failed, too.- Returns:
trueif, and only if, the failure of an order in this sequence implies the failure of all subsequent orders.
-
withFailureFatal
Creates a copy of this object, with the given failure-fatal flag.- Parameters:
failureFatal- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
getFinishedTime
Returns the point of time at which this order sequence has been processed completely. If the order sequence has not been finished, yet,Instant.MAXis returned.- Returns:
- The point of time at which this order sequence has been processed competely,
or
Instant.MAX, if the order sequence has not been processed completely, yet.
-
withFinishedTime
Creates a copy of this object, with the given finished time.- Parameters:
finishedTime- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
getIntendedVehicle
Returns a reference to the vehicle that is intended to process this order sequence.- Returns:
- A reference to the vehicle that is intended to process this
order sequence. If this sequence is free to be processed by any vehicle,
nullis returned.
-
withIntendedVehicle
Creates a copy of this object, with the given intended vehicle.- Parameters:
intendedVehicle- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
getProcessingVehicle
Returns a reference to the vehicle currently processing this sequence.- Returns:
- A reference to the vehicle currently processing this sequence. If
this sequence has not been processed, yet,
nullis returned.
-
withProcessingVehicle
Creates a copy of this object, with the given processing vehicle.- Parameters:
processingVehicle- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
toString
- Overrides:
toStringin classTCSObject<OrderSequence>
-