Package com.dna.jopt.util
Class ExtractUtil
java.lang.Object
com.dna.jopt.util.ExtractUtil
Util methods to extract objects from result of optimization
-
Method Summary
Modifier and TypeMethodDescriptionstatic Optional<ILogicEntityRoute>
Find any route satisfied by conditions in paramsgetNodeById
(IEntity entity, String id) Try to find node by id in routes of optimization entity in case of violations we don't try to find filtered nodesgetNodeById
(IEntity entity, String id, INodeUnassigner unassignNodeManager) Try to find node by ID in routes of optimization entity or unassignedNodeManager (in this case, if node was filtered, it is in UnassignedNodeManager)getNodesByType
(IEntity entity, Class<? extends INode> clazz) Find nodes by type in routes of optimization resultgetResource
(IEntity entity, IDutyHours whs) Find any resource in routes of optimization results who's duty hours intersect with parameter whsgetResource
(IEntity entity, String resourceId) find resource by ID in routes of optimization resultstatic List<ILogicEntityRoute>
getRoutes
(IEntity entity, IDutyHours whs) Get routes with resource duty hours got intersection with working hours specified by param whsstatic List<ILogicEntityRoute>
getRoutesHavingPillars
(IEntity entity) Get routes containing pillarsstatic List<ILogicEntityRoute>
getRoutesONS
(IEntity entity, Boolean justInUse) Get routes containing ONS nodesstatic List<IPillarNode>
getRoutesPillars
(IEntity entity) get pillar nodes of all result routes
-
Method Details
-
getNodeById
public static Optional<INode> getNodeById(IEntity entity, String id, INodeUnassigner unassignNodeManager) Try to find node by ID in routes of optimization entity or unassignedNodeManager (in this case, if node was filtered, it is in UnassignedNodeManager)- Parameters:
entity
- result of optimizationid
- idunassignNodeManager
- - try to find node in unassignNodeManager too- Returns:
- found node or empty result
-
getNodeById
Try to find node by id in routes of optimization entity in case of violations we don't try to find filtered nodes- Parameters:
entity
- result of optimizationid
- id- Returns:
- found node or empty result
-
getNodesByType
Find nodes by type in routes of optimization result- Parameters:
entity
- result of optimizationclazz
- type of node to find- Returns:
- list of found nodes or empty list
-
getResource
find resource by ID in routes of optimization result- Parameters:
entity
- result of optimizationresourceId
- resource Id- Returns:
- found resource or empty result
-
getResource
Find any resource in routes of optimization results who's duty hours intersect with parameter whs- Parameters:
entity
- result of optimizationwhs
- working hours to check- Returns:
- found resource or empty result
-
getRoutes
Get routes with resource duty hours got intersection with working hours specified by param whs- Parameters:
entity
- result of optimizationwhs
- working hours- Returns:
- list of found routes
-
getRoutesONS
Get routes containing ONS nodes- Parameters:
entity
- result of optimizationjustInUse
- take in account just elements which are in use in the routes- Returns:
- list of found routes or empty result
-
getRoutesPillars
get pillar nodes of all result routes- Parameters:
entity
- entity- Returns:
- list of routes or empty result
-
getRoutesHavingPillars
Get routes containing pillars- Parameters:
entity
- result of optimization- Returns:
- list of routes or empty result
-
findFirstRoute
public static Optional<ILogicEntityRoute> findFirstRoute(IEntity entity, Optional<String> resourceId, Boolean pillars, Boolean anchors) Find any route satisfied by conditions in params- Parameters:
entity
- result of optimizationresourceId
- if present, look for routes containing this resource IDpillars
- if true, look for routes containing pillarsanchors
- if true, look for routes containing anchors- Returns:
- first found route or empty result
-