Interface INodeUnassigner
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
NodeUnassigner
This interface provides the methods to unassign a
INode
from an ILogicEntityRoute
.
A Node
can get unassigned
in two ways: Either through the
AutoFilter
or it
contained hard constraint violations
.
- Since:
- 26/07/2019
- Version:
- 14/02/2020
- Author:
- DNA
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addUnassignedNodes
(List<? extends IOptimizationElement> unassignedNodes) Removes from the input allNodes
that were alreadyunassigned
so there are no duplicates, then adds the remainingNodes
to the list.void
Clears thelist
ofunassign Nodes
.copy()
Gets the firstNode
inunassigned Node
corresponding with that Id.Gets a newArrayList
with all theunassigned Nodes
.Gets all theunassigned Nodes
with that ID.int
Gets the number ofunassigned Nodes
.boolean
Returnstrue
if there are alreadyunassigned Nodes
.boolean
removeUnassignedNode
(IOptimizationElement unassignedNode) Removes the givenNodes
fromlist
ofunassigned Nodes
.boolean
removeUnassignedNodes
(List<? extends IOptimizationElement> unassignedNodes) Removes the input from theList
ofunassigned Nodes
, then returns the remainingunassigned Nodes
.unassignNodes
(List<IEntity> entities, List<IOptimizationElement> unassignedNodes) Unassigns the givenNodes
.
-
Method Details
-
unassignNodes
List<INodeFilterReason> unassignNodes(List<IEntity> entities, List<IOptimizationElement> unassignedNodes) Unassigns the givenNodes
. IfNodes
wererelated
to theNodes
to be unassigned, itsresource constraints
get detached andINode#setUnassigned(boolean)
is set totrue
.- Parameters:
entities
- the list of iEntities of theNodes
unassignedNodes
- the list of iOptimizationElements to be unassigned- Returns:
- the list
-
cleanUnassignedNodeList
void cleanUnassignedNodeList()Clears thelist
ofunassign Nodes
. -
removeUnassignedNode
Removes the givenNodes
fromlist
ofunassigned Nodes
.- Parameters:
unassignedNode
- the iOptimizationElement nodes to be unassigned- Returns:
- the list of remaining iOptimizationElement
-
addUnassignedNodes
Removes from the input allNodes
that were alreadyunassigned
so there are no duplicates, then adds the remainingNodes
to the list.- Parameters:
unassignedNodes
- the iOptimizationElement Nodes to be added to the list
-
hasUnassignedNodes
boolean hasUnassignedNodes()Returnstrue
if there are alreadyunassigned Nodes
.- Returns:
false
noNodes
have been unassigned yet
-
removeUnassignedNodes
Removes the input from theList
ofunassigned Nodes
, then returns the remainingunassigned Nodes
.- Parameters:
unassignedNodes
- the iOptimizationElement to be removed- Returns:
- the remaining unassigned nodes
-
getUnassignedNodesById
Gets all theunassigned Nodes
with that ID.- Parameters:
id
- the string id of theNodes
- Returns:
- the
Nodes
with that ID
-
getUnassignedFirstNodeById
Gets the firstNode
inunassigned Node
corresponding with that Id.- Parameters:
id
- the string Id of theNode
- Returns:
- the first
Node
found with that ID
-
getUnassignedNodes
List<IOptimizationElement> getUnassignedNodes()Gets a newArrayList
with all theunassigned Nodes
.- Returns:
- the list of unassignedNodes
-
getUnassignedNodesCount
int getUnassignedNodesCount()Gets the number ofunassigned Nodes
.- Returns:
- the number of
unassigned Nodes
-
copy
INodeUnassigner copy()
-