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 TypeMethodDescriptionvoidaddUnassignedNodes(List<? extends IOptimizationElement> unassignedNodes) Removes from the input allNodesthat were alreadyunassignedso there are no duplicates, then adds the remainingNodesto the list.voidClears thelistofunassign Nodes.copy()Gets the firstNodeinunassigned Nodecorresponding with that Id.Gets a newArrayListwith all theunassigned Nodes.Gets all theunassigned Nodeswith that ID.intGets the number ofunassigned Nodes.booleanReturnstrueif there are alreadyunassigned Nodes.booleanremoveUnassignedNode(IOptimizationElement unassignedNode) Removes the givenNodesfromlistofunassigned Nodes.booleanremoveUnassignedNodes(List<? extends IOptimizationElement> unassignedNodes) Removes the input from theListofunassigned 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. IfNodeswererelatedto theNodesto be unassigned, itsresource constraintsget detached andINode#setUnassigned(boolean)is set totrue.- Parameters:
entities- the list of iEntities of theNodesunassignedNodes- the list of iOptimizationElements to be unassigned- Returns:
- the list
-
cleanUnassignedNodeList
void cleanUnassignedNodeList()Clears thelistofunassign Nodes. -
removeUnassignedNode
Removes the givenNodesfromlistofunassigned Nodes.- Parameters:
unassignedNode- the iOptimizationElement nodes to be unassigned- Returns:
- the list of remaining iOptimizationElement
-
addUnassignedNodes
Removes from the input allNodesthat were alreadyunassignedso there are no duplicates, then adds the remainingNodesto the list.- Parameters:
unassignedNodes- the iOptimizationElement Nodes to be added to the list
-
hasUnassignedNodes
boolean hasUnassignedNodes()Returnstrueif there are alreadyunassigned Nodes.- Returns:
falsenoNodeshave been unassigned yet
-
removeUnassignedNodes
Removes the input from theListofunassigned Nodes, then returns the remainingunassigned Nodes.- Parameters:
unassignedNodes- the iOptimizationElement to be removed- Returns:
- the remaining unassigned nodes
-
getUnassignedNodesById
Gets all theunassigned Nodeswith that ID.- Parameters:
id- the string id of theNodes- Returns:
- the
Nodeswith that ID
-
getUnassignedFirstNodeById
Gets the firstNodeinunassigned Nodecorresponding with that Id.- Parameters:
id- the string Id of theNode- Returns:
- the first
Nodefound with that ID
-
getUnassignedNodes
List<IOptimizationElement> getUnassignedNodes()Gets a newArrayListwith 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()
-