Interface IEntity
- All Superinterfaces:
Cloneable,Serializable
- All Known Implementing Classes:
Entity
Entity contains all ILogicEntityRoute, IResource, INode etc.
of a current IOptimization.
This interface provides methods to add or remove Routes, get the costs getJoinedCost(), get the first matching Route of a Node etc.
- Since:
- 02/08/2019
- Version:
- 10/02/2020
- Author:
- DNA
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddRoute(int index, ILogicEntityRoute logicRoute) Adds aILogicEntityRouteat theindexposition, shifting theRouteat that position to the right and updating allindexesvoidaddRoute(ILogicEntityRoute logicRoute) Adds anILogicEntityRoute.copy()Copies the currentIEntity.exchangeExistingRoutesWithClones(List<ILogicEntityRoute> existingRoutes) exchangeExistingRouteWithClone(ILogicEntityRoute existingRoute) booleanexchangeExistingRouteWithExistingRoute(ILogicEntityRoute existingRouteOrg, ILogicEntityRoute existingRouteReplace) Gets allIOptimizationElementsof theIEntity.getAllRoutesElements(String resourceId) Returns allILogicEntityRoutewithanchorNodes, which are essentiallyIPillarNodesoverwriting the start or end of aRoute.longgetElement(String id) getElement(String id, boolean ignoreStartEnd) com.dna.jopt.framework.firstentitycreation.IEntityArrangerGets theIEntityArranger, responsible for creating a hard constraints freeIEntity.Gets theIEntityInvokedOperatorController.getFirstMatchingRoute(INode node) getFirstMatchingRoute(String nodeId) Returns the firstILogicEntityRoutein which theINodeorIPillarNodewith the inputnodeIdwas found.doubleGets thejoined costwhich is the accumulated sum ofinternal costof allIlogicEntityRoutesof theIEntity.Gets theIJoinedEntityDetailControllerwhich is assessing the times and distances of theILogicEntityRoutes.Gets theIMultiWorkingHoursConstraintControllerwhich controls the costs for violatingIConstraintsorIWorkingHours.Gets all theIOptimizationElementsthat will not be optimized anymore because they are in the past for example.Gets allIOptimizationElementof allILogicEntityRoutes.getRoute(int index) Gets theILogicEntityRouteaccording to theindex.getRouteByResourceAndWorkingHoursIndex(IResource res, int index) intGets the current number ofRoutes.Gets the routeiterator.Gets the wholelistofILogicEntityRoutes.getRoutesContainingElementId(String elementId) getRoutesContainingElementId(String elementId, boolean ignoreStartEnd) getRoutesContainingElementId(String elementId, String visitor, boolean ignoreStartEnd) intGets the number of allIOptimizationElement.intintintGets the total number ofIOptimizationElementswithin theILogicEntityRoutes.intintbooleanbooleanhasResource(String resourceId) booleanpartialCopy(List<ILogicEntityRoute> routes2BeCopied) Returns anIEntityin which only the inputILogicEntityRoutesare actual copies, the rest of theIEntityconsists of references to the originalObject.partialCopyExchangeExistingRoute(ILogicEntityRoute existingRouteOrg, ILogicEntityRoute existingRouteReplace) voidremoveRoute(int index) voidremoveRoute(ILogicEntityRoute remRoute) Removes anILogicEntityRoutefrom anIEntity.voidsetEntityArranger(com.dna.jopt.framework.firstentitycreation.IEntityArranger entityArranger) Sets theIEntityArranger.voidvoidSets theIEntityInvokedOperatorControllerwhich holds information oncost advantageof the last usedOperatoretc.voidsetIsRequestAllRoutesElementDetails(boolean requestAllElementDetails) Sets theresultrequestedvalue of allILogicEntityRoutes.voidsetIsUnassessed(boolean isUnassessed) Sets theunassessedstatus.voidsetJoinedCost(double cost) Sets thejoined costwhich is the accumulated sum ofinternal costof allIlogicEntityRoutesof theIEntity.voidsetJoinedDetailController(IJoinedEntityDetailController joinedDetailController) Sets theIJoinedEntityDetailControllerwhich is assessing the times and distances of theILogicEntityRoutes.voidSets theIMultiWorkingHoursConstraintControllerwhich controls the costs for violatingIConstraintsorIWorkingHours.voidsetRelationShipController(IRelationshipController relationshipController) voidsetRoutes(List<ILogicEntityRoute> routes) Prints the result of theIOptimizationwith the number ofILogicEntityRoute, number ofIOptimizationElement, total time, distance, idle time etc.toString()Returns aStringrepresenting theIEntityobject.toString(boolean showNonSchedudledRoutes) voidInstantiates a newIJoinedEntityDetailControllerand adds the values of allILogicEntityRoutethat were notunassigned.voidAdds the value ofdistance, idle time, productive time, transit timeetc of the inputILogicEntityRouteto theIJoinedEntityDetailControllerof theIEntity.
-
Method Details
-
getRouteIterator
ListIterator<ILogicEntityRoute> getRouteIterator()Gets the routeiterator.- Returns:
- the route iterator
-
addRoute
Adds anILogicEntityRoute.- Parameters:
logicRoute- the route
-
getRouteCount
int getRouteCount()Gets the current number ofRoutes.- Returns:
- the route count
- See Also:
-
getTotalRoutesOptimizableElementsCount
int getTotalRoutesOptimizableElementsCount()Gets the total number ofIOptimizationElementswithin theILogicEntityRoutes.- Returns:
- the total route element count
-
getRoute
Gets theILogicEntityRouteaccording to theindex.- Parameters:
index- the int index- Returns:
- the iLogicEntityRoute route
-
getRoutes
List<ILogicEntityRoute> getRoutes()Gets the wholelistofILogicEntityRoutes.- Returns:
- all the routes in the
IEntity
-
copy
IEntity copy()Copies the currentIEntity.- Returns:
- the copy of the
IEntity
-
setRoutes
Sets the inputILogicEntityRouteas theILogicEntityRoutesof anIEntity. This method should ONLY be used for copy/clone. In addition this method is not adapting the tutorEntity automatically. This has to be done externally.- Parameters:
routes- the iLogicEntityRoutes that are copied to the copy of theIEntity
-
removeRoute
Removes anILogicEntityRoutefrom anIEntity.- Parameters:
remRoute- the route to remove
-
removeRoute
void removeRoute(int index) - Parameters:
index- the int index
-
toString
String toString()Returns aStringrepresenting theIEntityobject.Some information is given on the
ILogicEntityRouteslike theproductive timeand theidle time. -
getJoinedDetailController
IJoinedEntityDetailController getJoinedDetailController()Gets theIJoinedEntityDetailControllerwhich is assessing the times and distances of theILogicEntityRoutes.- Returns:
- the
IJoinedEntityDetailController
-
setJoinedDetailController
Sets theIJoinedEntityDetailControllerwhich is assessing the times and distances of theILogicEntityRoutes.- Parameters:
joinedDetailController- the iJoinedEntityDetailController to set
-
getRouteViolationSummaries
List<IViolationSummary> getRouteViolationSummaries()- Returns:
- the summarized IViolations
-
setEntityArranger
void setEntityArranger(com.dna.jopt.framework.firstentitycreation.IEntityArranger entityArranger) Sets theIEntityArranger.- Parameters:
entityArranger- the iEntityArranger
-
getEntityArranger
com.dna.jopt.framework.firstentitycreation.IEntityArranger getEntityArranger()Gets theIEntityArranger, responsible for creating a hard constraints freeIEntity.- Returns:
- the
IEntityArranger
-
getEntityCostAndViolationController
IEntityCostAndViolationController getEntityCostAndViolationController()- Returns:
- the
IEntityCostAndViolationController
-
setEntityCostAndViolationController
- Parameters:
controller- the iEntityCostAndViolationController
-
setJoinedCost
void setJoinedCost(double cost) Sets thejoined costwhich is the accumulated sum ofinternal costof allIlogicEntityRoutesof theIEntity.- Parameters:
cost- the double internal costs of the wholeIEntity
-
getJoinedCost
double getJoinedCost()Gets thejoined costwhich is the accumulated sum ofinternal costof allIlogicEntityRoutesof theIEntity.- Returns:
- the total of internal costs of the
IEntity
-
getAllEntityElements
List<IOptimizationElement> getAllEntityElements()Gets allIOptimizationElementsof theIEntity.- Returns:
- all
IOptimizationElements
-
getNoneOptimizableElements
List<IOptimizationElement> getNoneOptimizableElements()Gets all theIOptimizationElementsthat will not be optimized anymore because they are in the past for example.- Returns:
- the list of
noneOptimizableElements
-
getOptimizableElements
List<IOptimizationElement> getOptimizableElements()Gets allIOptimizationElementof allILogicEntityRoutes.- Returns:
- all
optimizable Elements
-
getAllRoutesElements
- Parameters:
resourceId- the string to search for- Returns:
- the search results containing the input
-
hasResource
- Parameters:
resourceId- the stringIdto search for- Returns:
trueif aResourcecontaining thisIdexists
-
hasNode
- Parameters:
nodeId- the stringIdto search for- Returns:
trueif any of theElementscontains theId
-
addRoute
Adds aILogicEntityRouteat theindexposition, shifting theRouteat that position to the right and updating allindexes- Parameters:
index- the int index which theRoutewill havelogicRoute- the iLogicEntityRoute to add
-
setIsRequestAllRoutesElementDetails
void setIsRequestAllRoutesElementDetails(boolean requestAllElementDetails) Sets theresultrequestedvalue of allILogicEntityRoutes. If set totruetheILogicRouteElementDetailItemsare getting saved.- Parameters:
requestAllElementDetails- the boolean to set
-
partialCopy
Returns anIEntityin which only the inputILogicEntityRoutesare actual copies, the rest of theIEntityconsists of references to the originalObject. This shallow copy allows to make modifications to the respectiveRoutesof anIEntitywhile demanding less performance than a full copy.- Parameters:
routes2BeCopied- the iLogicEntityRoutes which are copied- Returns:
- an
Objectcontaining references to the originalIEntitywhile the inputRoutesare copies
-
exchangeExistingRouteWithClone
- Parameters:
existingRoute- the iLogicEntityRoute that is replaced with a copy- Returns:
- the cloned
ILogicEntityRoute
-
exchangeExistingRoutesWithClones
- Parameters:
existingRoutes- the iLogicEntityRoutes that are replaced with a copy- Returns:
- the copied list of the input
-
exchangeExistingRouteWithExistingRoute
boolean exchangeExistingRouteWithExistingRoute(ILogicEntityRoute existingRouteOrg, ILogicEntityRoute existingRouteReplace) Replaces anILogicEntityRoutewith anotherILogicEntityRoutein all theEntities.This is used in
lockdown.- Parameters:
existingRouteOrg- the iLogicEntityRoute to replaceexistingRouteReplace- the ILogicEntityRoute that will be put in its stead- Returns:
trueif the operation was successful
-
getTotalRoutesDistinctElementsCount
int getTotalRoutesDistinctElementsCount()Gets the number of allIOptimizationElement.- Returns:
- the number of
Elementsin all theRoute
-
toOverviewResult
String toOverviewResult()Prints the result of theIOptimizationwith the number ofILogicEntityRoute, number ofIOptimizationElement, total time, distance, idle time etc.- Returns:
- an overview of the result
-
getRelationshipController
IRelationshipController getRelationshipController()- Returns:
- details on the relationship
-
setRelationShipController
- Parameters:
relationshipController- the iRelationshipController to set
-
getEntityInvokedOperatorController
IEntityInvokedOperatorController getEntityInvokedOperatorController()Gets theIEntityInvokedOperatorController.- Returns:
- the
IEntityInvokedOperatorControllerwhich holds information oncost advantageof the lastOperatoretc.
-
setEntityInvokedOperatorController
Sets theIEntityInvokedOperatorControllerwhich holds information oncost advantageof the last usedOperatoretc.- Parameters:
opc- the iEntityInvokedOperatorController
-
getFirstMatchingRoute
- Parameters:
node- the iNode to look for- Returns:
- the first found
Routecontaining theNode
-
getFirstMatchingRoute
Returns the firstILogicEntityRoutein which theINodeorIPillarNodewith the inputnodeIdwas found.- Parameters:
nodeId- the string Id of theNodeto look for.- Returns:
- the
Routein which theNodeorPillarwas found.
-
getAnchoredRoutes
List<ILogicEntityRoute> getAnchoredRoutes()Returns allILogicEntityRoutewithanchorNodes, which are essentiallyIPillarNodesoverwriting the start or end of aRoute.- Returns:
- the list of
RouteswithanchorNodes
-
updateJointEntityBaseValueWithRoute
Adds the value ofdistance, idle time, productive time, transit timeetc of the inputILogicEntityRouteto theIJoinedEntityDetailControllerof theIEntity.- Parameters:
route- the iLogicEntityRoute of which the values should be added
-
updateJointEntityBaseValueWithOwnRoutes
void updateJointEntityBaseValueWithOwnRoutes()Instantiates a newIJoinedEntityDetailControllerand adds the values of allILogicEntityRoutethat were notunassigned. -
setMultiWorkingHoursConstraintController
Sets theIMultiWorkingHoursConstraintControllerwhich controls the costs for violatingIConstraintsorIWorkingHours.- Parameters:
controller- the iMultiWorkingHoursConstraintController to set
-
getMultiWorkingHoursConstraintController
IMultiWorkingHoursConstraintController getMultiWorkingHoursConstraintController()Gets theIMultiWorkingHoursConstraintControllerwhich controls the costs for violatingIConstraintsorIWorkingHours.- Returns:
- the
IMultiWorkingHoursConstraintController
-
setIsUnassessed
void setIsUnassessed(boolean isUnassessed) Sets theunassessedstatus.Being marked as
unassessedmeans that thisObjectwill have to go throughassessmentagain. For complete solutions theILogicEntityRoutesand allIEntitieshave to be assessed. When anINodeis shifted from oneRouteto another by anIOperatorthe respectiveRoutesandEntityneed to be marked asunassessedin order to getassessedagain updating theircostssince they might have changed. AnEntityalso needs to be set asunassessedwhensetIsRequestAllRoutesElementDetails(boolean)is set totrue. By doing this theRouteswill automatically be set tounassessedsince they need to go through a newassessmentin order to save theILogicRouteElementDetailItem- Parameters:
isUnassessed- the boolean to set
-
isUnassessed
boolean isUnassessed()- Returns:
- the set
value
-
partialCopyExchangeExistingRoute
IEntity partialCopyExchangeExistingRoute(ILogicEntityRoute existingRouteOrg, ILogicEntityRoute existingRouteReplace) -
toString
-
getResourceFirstOccurenceAbsoluteIndexMap
-
getRoutesByResource
-
getRoutesContainingElementId
-
getElement
-
getBuildTimeStamp
long getBuildTimeStamp() -
getElement
-
getRoutesContainingElementId
-
getRoutesContainingElementId
Optional<ILogicEntityRoute> getRoutesContainingElementId(String elementId, String visitor, boolean ignoreStartEnd) -
getAllNodes
List<IOptimizationElement> getAllNodes() -
getTotalRoutesDistinctNodesCount
int getTotalRoutesDistinctNodesCount() -
getTotalRoutesResourceCount
int getTotalRoutesResourceCount() -
getAllResources
-
getUnScheduledRoutesCount
int getUnScheduledRoutesCount() -
getRouteByResourceAndWorkingHoursIndex
-
getTotalRoutesDistinctPillarsCount
int getTotalRoutesDistinctPillarsCount()
-