Package org.opentcs.data.model

# Class Path

java.lang.Object
org.opentcs.data.TCSObject<E>
org.opentcs.data.model.TCSResource<Path>
org.opentcs.data.model.Path

All Implemented Interfaces:
  `java.io.Serializable`

    public class Path
    extends TCSResource<Path>
    implements java.io.Serializable

Describes a connection between two `Point`s which a `Vehicle` may traverse.

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

  ### Fields inherited from class org.opentcs.data.TCSObject

  `reference`

- ## 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.
  `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.

  ### Methods inherited from class org.opentcs.data.model.TCSResource

  `getReference`

  ### Methods inherited from class org.opentcs.data.TCSObject

  `equals, getHistory, getName, getProperties, getProperty, hashCode, listWithoutNullValues, mapWithoutNullValues, propertiesWith, setWithoutNullValues, toString`

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## 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

    public Path withProperty​(java.lang.String key, java.lang.String value)
    Description copied from class: `TCSObject`
    Creates a copy of this object, with the given property integrated.
    Specified by:
      `withProperty` in class `TCSObject<Path>`
    Parameters:
      `key` - The key of the property to be changed.
      `value` - The new value of the property, or `null`, if the property is to be removed.
    Returns:
      A copy of this object, with the given property integrated.

  - ### withProperties

    public Path withProperties​(java.util.Map<java.lang.String,​java.lang.String> properties)
    Description copied from class: `TCSObject`
    Creates a copy of this object, with the given properties.
    Specified by:
      `withProperties` in class `TCSObject<Path>`
    Parameters:
      `properties` - The properties.
    Returns:
      A copy of this object, with the given properties.

  - ### withHistoryEntry

    public TCSObject<Path> withHistoryEntry​(ObjectHistory.Entry entry)
    Description copied from class: `TCSObject`
    Creates a copy of this object, with the given history entry integrated.
    Specified by:
      `withHistoryEntry` in class `TCSObject<Path>`
    Parameters:
      `entry` - The history entry to be integrated.
    Returns:
      A copy of this object, with the given history entry integrated.

  - ### withHistory

    public TCSObject<Path> withHistory​(ObjectHistory history)
    Description copied from class: `TCSObject`
    Creates a copy of this object, with the given history.
    Specified by:
      `withHistory` in class `TCSObject<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

    public Path withLength​(long length)
    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

    public TCSObjectReference<Point> getSourcePoint()
    Returns a reference to the point which this path originates in.
    Returns:
      A reference to the point which this path originates in.

  - ### getDestinationPoint

    public TCSObjectReference<Point> 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

    public Path withMaxVelocity​(int maxVelocity)
    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

    public Path withMaxReverseVelocity​(int maxReverseVelocity)
    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

    public java.util.List<PeripheralOperation> 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), else `false`.

  - ### withLocked

    public Path withLocked​(boolean locked)
    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.

  - ### getLayout

    public Path.Layout getLayout()
    Returns the information regarding the grahical representation of this path.
    Returns:
      The information regarding the grahical representation of this path.

  - ### withLayout

    public Path withLayout​(Path.Layout layout)
    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.IllegalArgumentException
    Checks whether this path is navigable towards the given point.
    Parameters:
      `navPoint` - The point.
    Returns:
      If `navPoint` is this path's destination point, returns `isNavigableForward()`; if `navPoint` is this path's source point, returns `isNavigableReverse()`.
    Throws:
      `java.lang.IllegalArgumentException` - If the given point is neither the source point nor the destination point of this path.