-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deprecate methods in the Router interface
The methods selectRoute(), getSelectedRoute() and getTargetedPoints() in the Router interface are now deprecated because they have not been used or do not belong to the routers designated tasks and therefore were outsourced to the classes where the logic belongs. Merged-by: Martin Grzenia <[email protected]>
- Loading branch information
Showing
16 changed files
with
237 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
.../src/main/java/org/opentcs/strategies/basic/dispatching/phase/TargetedPointsSupplier.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// SPDX-FileCopyrightText: The openTCS Authors | ||
// SPDX-License-Identifier: MIT | ||
package org.opentcs.strategies.basic.dispatching.phase; | ||
|
||
import static java.util.Objects.requireNonNull; | ||
|
||
import jakarta.inject.Inject; | ||
import java.util.Set; | ||
import java.util.stream.Collectors; | ||
import org.opentcs.components.kernel.services.TCSObjectService; | ||
import org.opentcs.data.model.Point; | ||
import org.opentcs.data.order.TransportOrder; | ||
|
||
/** | ||
* A point supplier that tries to find all points which are currently targeted by vehicles. | ||
*/ | ||
public class TargetedPointsSupplier { | ||
|
||
/** | ||
* The object service. | ||
*/ | ||
private final TCSObjectService objectService; | ||
|
||
@Inject | ||
public TargetedPointsSupplier(TCSObjectService objectService) { | ||
this.objectService = requireNonNull(objectService, "objectService"); | ||
} | ||
|
||
/** | ||
* Returns all points which are currently targeted by vehicles. | ||
* | ||
* @return A set of all points currently targeted by vehicles. | ||
*/ | ||
public Set<Point> getTargetedPoints() { | ||
return objectService | ||
.fetchObjects( | ||
TransportOrder.class, | ||
order -> order.hasState(TransportOrder.State.BEING_PROCESSED) | ||
) | ||
.stream() | ||
.map( | ||
transportOrder -> transportOrder.getAllDriveOrders().getLast().getRoute() | ||
.getFinalDestinationPoint() | ||
) | ||
.collect(Collectors.toSet()); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.