Package org.opentcs.data.order
Class Route.Step
java.lang.Object
org.opentcs.data.order.Route.Step
- All Implemented Interfaces:
Serializable
- Enclosing class:
Route
A single step in a route.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionStep(Path path, Point srcPoint, Point destPoint, Vehicle.Orientation orientation, int routeIndex) Deprecated.Step(Path path, Point srcPoint, Point destPoint, Vehicle.Orientation orientation, int routeIndex, boolean executionAllowed) Deprecated.UseStep(Path, Point, Point, Vehicle.Orientation, int, long)in combination withwithExecutionAllowed(boolean)instead.Step(Path path, Point srcPoint, Point destPoint, Vehicle.Orientation orientation, int routeIndex, boolean executionAllowed, ReroutingType reroutingType) Deprecated.UseStep(Path, Point, Point, Vehicle.Orientation, int, long)in combination withwithExecutionAllowed(boolean)andwithReroutingType(ReroutingType)instead.Step(Path path, Point srcPoint, Point destPoint, Vehicle.Orientation orientation, int routeIndex, long costs) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanequalsInMovement(Route.Step step) Compares the given step to this step, ignoring rerouting-related properties.longgetCosts()Returns the costs for travelling the path.Returns the point that is reached by travelling the path.getPath()Returns the path to travel.Returns theReroutingTypeof this step.intReturns this step's index in the vehicle's route.Returns the point that the vehicle is starting from.Returns the direction into which the vehicle is supposed to travel.inthashCode()booleanReturns whether execution of this step is allowed.toString()withCosts(long costs) Creates a copy of this object, with the given costs.withDestinationPoint(Point destinationPoint) Creates a copy of this object, with the given destination point.withExecutionAllowed(boolean executionAllowed) Creates a copy of this object, with the given execution allowed flag.Creates a copy of this object, with the given path.withReroutingType(ReroutingType reroutingType) Creates a copy of this object, with the given rerouting type.withRouteIndex(int routeIndex) Creates a copy of this object, with the given route index.withSourcePoint(Point sourcePoint) Creates a copy of this object, with the given source point.withVehicleOrientation(Vehicle.Orientation vehicleOrientation) Creates a copy of this object, with the given vehicle orientation.
-
Constructor Details
-
Step
@Deprecated @ScheduledApiChange(when="7.0", details="Will be removed.") public Step(@Nullable Path path, @Nullable Point srcPoint, @Nonnull Point destPoint, @Nonnull Vehicle.Orientation orientation, int routeIndex, boolean executionAllowed, @Nullable ReroutingType reroutingType) Deprecated.UseStep(Path, Point, Point, Vehicle.Orientation, int, long)in combination withwithExecutionAllowed(boolean)andwithReroutingType(ReroutingType)instead.Creates a new instance.- Parameters:
path- The path to travel.srcPoint- The point that the vehicle is starting from.destPoint- The point that is reached by travelling the path.orientation- The vehicle's orientation on this step.routeIndex- This step's index in the vehicle's route.executionAllowed- Whether execution of this step is allowed.reroutingType- Marks this step as the origin of a recalculated route.
-
Step
@Deprecated @ScheduledApiChange(when="7.0", details="Will be removed.") public Step(@Nullable Path path, @Nullable Point srcPoint, @Nonnull Point destPoint, @Nonnull Vehicle.Orientation orientation, int routeIndex, boolean executionAllowed) Deprecated.UseStep(Path, Point, Point, Vehicle.Orientation, int, long)in combination withwithExecutionAllowed(boolean)instead.Creates a new instance.- Parameters:
path- The path to travel.srcPoint- The point that the vehicle is starting from.destPoint- The point that is reached by travelling the path.orientation- The vehicle's orientation on this step.routeIndex- This step's index in the vehicle's route.executionAllowed- Whether execution of this step is allowed.
-
Step
@Deprecated @ScheduledApiChange(when="7.0", details="Will be removed.") public Step(@Nullable Path path, @Nullable Point srcPoint, @Nonnull Point destPoint, @Nonnull Vehicle.Orientation orientation, int routeIndex) Deprecated.Creates a new instance.- Parameters:
path- The path to travel.srcPoint- The point that the vehicle is starting from.destPoint- The point that is reached by travelling the path.orientation- The vehicle's orientation on this step.routeIndex- This step's index in the vehicle's route.
-
Step
public Step(@Nullable Path path, @Nullable Point srcPoint, @Nonnull Point destPoint, @Nonnull Vehicle.Orientation orientation, int routeIndex, long costs) Creates a new instance.The created step will have its
executionAllowedflag set totrueand itsreroutingTypeset tonull.- Parameters:
path- The path to travel.srcPoint- The point that the vehicle is starting from.destPoint- The point that is reached by travelling the path.orientation- The vehicle's orientation on this step.routeIndex- This step's index in the vehicle's route.costs- The costs for travelling the path.
-
-
Method Details
-
getPath
Returns the path to travel.- Returns:
- The path to travel. May be
nullif the vehicle does not really have to move.
-
withPath
Creates a copy of this object, with the given path.- Parameters:
path- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
getSourcePoint
Returns the point that the vehicle is starting from.- Returns:
- The point that the vehicle is starting from.
May be
nullif the vehicle does not really have to move.
-
withSourcePoint
Creates a copy of this object, with the given source point.- Parameters:
sourcePoint- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
getDestinationPoint
Returns the point that is reached by travelling the path.- Returns:
- The point that is reached by travelling the path.
-
withDestinationPoint
Creates a copy of this object, with the given destination point.- Parameters:
destinationPoint- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
getVehicleOrientation
Returns the direction into which the vehicle is supposed to travel.- Returns:
- The direction into which the vehicle is supposed to travel.
-
withVehicleOrientation
Creates a copy of this object, with the given vehicle orientation.- Parameters:
vehicleOrientation- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
getRouteIndex
public int getRouteIndex()Returns this step's index in the vehicle's route.- Returns:
- This step's index in the vehicle's route.
-
withRouteIndex
Creates a copy of this object, with the given route index.- Parameters:
routeIndex- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
getCosts
public long getCosts()Returns the costs for travelling the path.- Returns:
- The costs for travelling the path.
-
withCosts
Creates a copy of this object, with the given costs.- Parameters:
costs- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
isExecutionAllowed
public boolean isExecutionAllowed()Returns whether execution of this step is allowed.- Returns:
true, if execution of this step is allowed, otherwisefalse.
-
withExecutionAllowed
Creates a copy of this object, with the given execution allowed flag.- Parameters:
executionAllowed- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
getReroutingType
Returns theReroutingTypeof this step.Indicates whether this step is the origin of a recalculated route, and if so, which
ReroutingTypewas used to determine the (new) route.Might return
null, if this step is not the origin of a recalculated route.- Returns:
- The
ReroutingTypeof this step.
-
withReroutingType
Creates a copy of this object, with the given rerouting type.- Parameters:
reroutingType- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
equals
-
equalsInMovement
Compares the given step to this step, ignoring rerouting-related properties.- Parameters:
step- The step to compare to.- Returns:
true, if the given step is equal to this step (ignoring rerouting-related properties), otherwisefalse.
-
hashCode
public int hashCode() -
toString
-
Step(Path, Point, Point, Vehicle.Orientation, int, long)instead.