Package org.opentcs.data.model
Class Path
java.lang.Object
- All Implemented Interfaces:
java.io.Serializable
public class Path extends TCSResource<Path> implements java.io.Serializable
- See Also:
- Serialized Form
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Path.Layout
Contains information regarding the grahical representation of a path. -
Field Summary
-
Constructor Summary
Constructors Constructor Description Path(java.lang.String name, TCSObjectReference<Point> sourcePoint, TCSObjectReference<Point> destinationPoint)
Creates a new Path. -
Method Summary
Modifier and Type Method Description TCSObjectReference<Point>
getDestinationPoint()
Returns a reference to the point which this path ends in.Path.Layout
getLayout()
Returns the information regarding the grahical representation of this path.long
getLength()
Return the length of this path (in mm).int
getMaxReverseVelocity()
Return the maximum allowed reverse velocity (in mm/s) for this path.int
getMaxVelocity()
Return the maximum allowed forward velocity (in mm/s) for this path.java.util.List<PeripheralOperation>
getPeripheralOperations()
Returns the peripheral operations to be performed when a vehicle travels along this path.TCSObjectReference<Point>
getSourcePoint()
Returns a reference to the point which this path originates in.java.util.Map<java.lang.String,Envelope>
getVehicleEnvelopes()
Returns a map of envelope keys to envelopes that vehicles traversing this path may occupy.boolean
isLocked()
Return the lock status of this path (i.e.boolean
isNavigableForward()
Checks whether this path is navigable in forward direction.boolean
isNavigableReverse()
Checks whether this path is navigable in backward/reverse direction.boolean
isNavigableTo(TCSObjectReference<Point> navPoint)
Checks whether this path is navigable towards the given point.TCSObject<Path>
withHistory(ObjectHistory history)
Creates a copy of this object, with the given history.TCSObject<Path>
withHistoryEntry(ObjectHistory.Entry entry)
Creates a copy of this object, with the given history entry integrated.Path
withLayout(Path.Layout layout)
Creates a copy of this object, with the given layout.Path
withLength(long length)
Creates a copy of this object, with the given length.Path
withLocked(boolean locked)
Creates a copy of this object, with the given locked flag.Path
withMaxReverseVelocity(int maxReverseVelocity)
Creates a copy of this object, with the given maximum reverse velocity.Path
withMaxVelocity(int maxVelocity)
Creates a copy of this object, with the given maximum velocity.Path
withPeripheralOperations(java.util.List<PeripheralOperation> peripheralOperations)
Creates a copy of this object, with the given peripheral operations.Path
withProperties(java.util.Map<java.lang.String,java.lang.String> properties)
Creates a copy of this object, with the given properties.Path
withProperty(java.lang.String key, java.lang.String value)
Creates a copy of this object, with the given property integrated.Path
withVehicleEnvelopes(java.util.Map<java.lang.String,Envelope> vehicleEnvelopes)
Creates a copy of this object, with the given vehicle envelopes.Methods inherited from class org.opentcs.data.TCSObject
equals, getHistory, getName, getProperties, getProperty, hashCode, listWithoutNullValues, mapWithoutNullValues, propertiesWith, setWithoutNullValues, toString
-
Constructor Details
-
Path
public Path(java.lang.String name, TCSObjectReference<Point> sourcePoint, TCSObjectReference<Point> destinationPoint)Creates a new Path.- Parameters:
name
- The new path's name.sourcePoint
- A reference to this path's starting point.destinationPoint
- A reference to this path's destination point.
-
-
Method Details
-
withProperty
Description copied from class:TCSObject
Creates a copy of this object, with the given property integrated.- Specified by:
withProperty
in classTCSObject<Path>
- 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:TCSObject
Creates a copy of this object, with the given properties.- Specified by:
withProperties
in classTCSObject<Path>
- Parameters:
properties
- The properties.- Returns:
- A copy of this object, with the given properties.
-
withHistoryEntry
Description copied from class:TCSObject
Creates a copy of this object, with the given history entry integrated.- Specified by:
withHistoryEntry
in classTCSObject<Path>
- 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:TCSObject
Creates a copy of this object, with the given history.- Specified by:
withHistory
in classTCSObject<Path>
- Parameters:
history
- The history.- Returns:
- A copy of this object, with the given history.
-
getLength
public long getLength()Return the length of this path (in mm).- Returns:
- The length of this path (in mm).
-
withLength
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.
-
getSourcePoint
Returns a reference to the point which this path originates in.- Returns:
- A reference to the point which this path originates in.
-
getDestinationPoint
Returns a reference to the point which this path ends in.- Returns:
- A reference to the point which this path ends in.
-
getMaxVelocity
public int getMaxVelocity()Return the maximum allowed forward velocity (in mm/s) for this path.- Returns:
- The maximum allowed forward velocity (in mm/s). A value of 0 means forward movement is not allowed on this path.
-
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()Return the maximum allowed reverse velocity (in mm/s) for this path.- Returns:
- The maximum allowed reverse velocity (in mm/s). A value of 0 means reverse movement is not allowed on this path.
-
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.
-
getPeripheralOperations
Returns the peripheral operations to be performed when a vehicle travels along this path.- Returns:
- The peripheral operations to be performed when a vehicle travels along this path.
-
withPeripheralOperations
public Path withPeripheralOperations(@Nonnull java.util.List<PeripheralOperation> peripheralOperations)Creates a copy of this object, with the given peripheral operations.- Parameters:
peripheralOperations
- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
isLocked
public boolean isLocked()Return the lock status of this path (i.e. whether this path my be used by vehicles or not).- Returns:
true
if this path is currently locked (i.e. it may not be used by vehicles), elsefalse
.
-
withLocked
Creates a copy of this object, with the given locked flag.- Parameters:
locked
- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
getVehicleEnvelopes
Returns a map of envelope keys to envelopes that vehicles traversing this path may occupy.- Returns:
- A map of envelope keys to envelopes that vehicles traversing this path may occupy.
-
withVehicleEnvelopes
Creates a copy of this object, with the given vehicle envelopes.- Parameters:
vehicleEnvelopes
- 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 grahical representation of this path.- Returns:
- The information regarding the grahical representation of this path.
-
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.
-
isNavigableForward
public boolean isNavigableForward()Checks whether this path is navigable in forward direction.- Returns:
true
if, and only if, this path is not locked and its maximum forward velocity is not zero.
-
isNavigableReverse
public boolean isNavigableReverse()Checks whether this path is navigable in backward/reverse direction.- Returns:
true
if, and only if, this path is not locked and its maximum reverse velocity is not zero.
-
isNavigableTo
public boolean isNavigableTo(TCSObjectReference<Point> navPoint) throws java.lang.IllegalArgumentExceptionChecks whether this path is navigable towards the given point.- Parameters:
navPoint
- The point.- Returns:
- If
navPoint
is this path's destination point, returnsisNavigableForward()
; ifnavPoint
is this path's source point, returnsisNavigableReverse()
. - Throws:
java.lang.IllegalArgumentException
- If the given point is neither the source point nor the destination point of this path.
-