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 TypeMethodDescriptionvoid
addRoute
(int index, ILogicEntityRoute logicRoute) Adds aILogicEntityRoute
at theindex
position, shifting theRoute
at that position to the right and updating allindexes
void
addRoute
(ILogicEntityRoute logicRoute) Adds anILogicEntityRoute
.copy()
Copies the currentIEntity
.exchangeExistingRoutesWithClones
(List<ILogicEntityRoute> existingRoutes) exchangeExistingRouteWithClone
(ILogicEntityRoute existingRoute) boolean
exchangeExistingRouteWithExistingRoute
(ILogicEntityRoute existingRouteOrg, ILogicEntityRoute existingRouteReplace) Gets allIOptimizationElements
of theIEntity
.getAllRoutesElements
(String resourceId) Returns allILogicEntityRoute
withanchorNodes
, which are essentiallyIPillarNodes
overwriting the start or end of aRoute
.long
getElement
(String id) getElement
(String id, boolean ignoreStartEnd) com.dna.jopt.framework.firstentitycreation.IEntityArranger
Gets theIEntityArranger
, responsible for creating a hard constraints freeIEntity
.Gets theIEntityInvokedOperatorController
.getFirstMatchingRoute
(INode node) getFirstMatchingRoute
(String nodeId) Returns the firstILogicEntityRoute
in which theINode
orIPillarNode
with the inputnodeId
was found.double
Gets thejoined cost
which is the accumulated sum ofinternal cost
of allIlogicEntityRoutes
of theIEntity
.Gets theIJoinedEntityDetailController
which is assessing the times and distances of theILogicEntityRoutes
.Gets theIMultiWorkingHoursConstraintController
which controls the costs for violatingIConstraints
orIWorkingHours
.Gets all theIOptimizationElements
that will not be optimized anymore because they are in the past for example.Gets allIOptimizationElement
of allILogicEntityRoutes
.getRoute
(int index) Gets theILogicEntityRoute
according to theindex
.int
Gets the current number ofRoutes
.Gets the routeiterator
.Gets the wholelist
ofILogicEntityRoutes
.getRoutesContainingElementId
(String elementId) getRoutesContainingElementId
(String elementId, boolean ignoreStartEnd) getRoutesContainingElementId
(String elementId, String visitor, boolean ignoreStartEnd) int
Gets the number of allIOptimizationElement
.int
Gets the total number ofIOptimizationElements
within theILogicEntityRoutes
.boolean
boolean
hasResource
(String resourceId) boolean
partialCopy
(List<ILogicEntityRoute> routes2BeCopied) Returns anIEntity
in which only the inputILogicEntityRoutes
are actual copies, the rest of theIEntity
consists of references to the originalObject
.partialCopyExchangeExistingRoute
(ILogicEntityRoute existingRouteOrg, ILogicEntityRoute existingRouteReplace) void
removeRoute
(int index) void
removeRoute
(ILogicEntityRoute remRoute) Removes anILogicEntityRoute
from anIEntity
.void
setEntityArranger
(com.dna.jopt.framework.firstentitycreation.IEntityArranger entityArranger) Sets theIEntityArranger
.void
void
Sets theIEntityInvokedOperatorController
which holds information oncost advantage
of the last usedOperator
etc.void
setIsRequestAllRoutesElementDetails
(boolean requestAllElementDetails) Sets theresultrequested
value of allILogicEntityRoutes
.void
setIsUnassessed
(boolean isUnassessed) Sets theunassessed
status.void
setJoinedCost
(double cost) Sets thejoined cost
which is the accumulated sum ofinternal cost
of allIlogicEntityRoutes
of theIEntity
.void
setJoinedDetailController
(IJoinedEntityDetailController joinedDetailController) Sets theIJoinedEntityDetailController
which is assessing the times and distances of theILogicEntityRoutes
.void
Sets theIMultiWorkingHoursConstraintController
which controls the costs for violatingIConstraints
orIWorkingHours
.void
setRelationShipController
(IRelationshipController relationshipController) void
setRoutes
(List<ILogicEntityRoute> routes) Prints the result of theIOptimization
with the number ofILogicEntityRoute
, number ofIOptimizationElement
, total time, distance, idle time etc.toString()
Returns aString
representing theIEntity
object.toString
(boolean showNonSchedudledRoutes) void
Instantiates a newIJoinedEntityDetailController
and adds the values of allILogicEntityRoute
that were notunassigned
.void
Adds the value ofdistance, idle time, productive time, transit time
etc of the inputILogicEntityRoute
to theIJoinedEntityDetailController
of 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 ofIOptimizationElements
within theILogicEntityRoutes
.- Returns:
- the total route element count
-
getRoute
Gets theILogicEntityRoute
according to theindex
.- Parameters:
index
- the int index- Returns:
- the iLogicEntityRoute route
-
getRoutes
List<ILogicEntityRoute> getRoutes()Gets the wholelist
ofILogicEntityRoutes
.- Returns:
- all the routes in the
IEntity
-
copy
IEntity copy()Copies the currentIEntity
.- Returns:
- the copy of the
IEntity
-
setRoutes
Sets the inputILogicEntityRoute
as theILogicEntityRoutes
of 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 anILogicEntityRoute
from anIEntity
.- Parameters:
remRoute
- the route to remove
-
removeRoute
void removeRoute(int index) - Parameters:
index
- the int index
-
toString
String toString()Returns aString
representing theIEntity
object.Some information is given on the
ILogicEntityRoutes
like theproductive time
and theidle time
. -
getJoinedDetailController
IJoinedEntityDetailController getJoinedDetailController()Gets theIJoinedEntityDetailController
which is assessing the times and distances of theILogicEntityRoutes
.- Returns:
- the
IJoinedEntityDetailController
-
setJoinedDetailController
Sets theIJoinedEntityDetailController
which 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 cost
which is the accumulated sum ofinternal cost
of allIlogicEntityRoutes
of theIEntity
.- Parameters:
cost
- the double internal costs of the wholeIEntity
-
getJoinedCost
double getJoinedCost()Gets thejoined cost
which is the accumulated sum ofinternal cost
of allIlogicEntityRoutes
of theIEntity
.- Returns:
- the total of internal costs of the
IEntity
-
getAllEntityElements
List<IOptimizationElement> getAllEntityElements()Gets allIOptimizationElements
of theIEntity
.- Returns:
- all
IOptimizationElements
-
getNoneOptimizableElements
List<IOptimizationElement> getNoneOptimizableElements()Gets all theIOptimizationElements
that will not be optimized anymore because they are in the past for example.- Returns:
- the list of
noneOptimizableElements
-
getOptimizableElements
List<IOptimizationElement> getOptimizableElements()Gets allIOptimizationElement
of allILogicEntityRoutes
.- Returns:
- all
optimizable Elements
-
getAllRoutesElements
- Parameters:
resourceId
- the string to search for- Returns:
- the search results containing the input
-
hasResource
- Parameters:
resourceId
- the stringId
to search for- Returns:
true
if aResource
containing thisId
exists
-
hasNode
- Parameters:
nodeId
- the stringId
to search for- Returns:
true
if any of theElements
contains theId
-
addRoute
Adds aILogicEntityRoute
at theindex
position, shifting theRoute
at that position to the right and updating allindexes
- Parameters:
index
- the int index which theRoute
will havelogicRoute
- the iLogicEntityRoute to add
-
setIsRequestAllRoutesElementDetails
void setIsRequestAllRoutesElementDetails(boolean requestAllElementDetails) Sets theresultrequested
value of allILogicEntityRoutes
. If set totrue
theILogicRouteElementDetailItems
are getting saved.- Parameters:
requestAllElementDetails
- the boolean to set
-
partialCopy
Returns anIEntity
in which only the inputILogicEntityRoutes
are actual copies, the rest of theIEntity
consists of references to the originalObject
. This shallow copy allows to make modifications to the respectiveRoutes
of anIEntity
while demanding less performance than a full copy.- Parameters:
routes2BeCopied
- the iLogicEntityRoutes which are copied- Returns:
- an
Object
containing references to the originalIEntity
while the inputRoutes
are 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 anILogicEntityRoute
with anotherILogicEntityRoute
in all theEntities
.This is used in
lockdown
.- Parameters:
existingRouteOrg
- the iLogicEntityRoute to replaceexistingRouteReplace
- the ILogicEntityRoute that will be put in its stead- Returns:
true
if the operation was successful
-
getTotalRoutesDistinctElementsCount
int getTotalRoutesDistinctElementsCount()Gets the number of allIOptimizationElement
.- Returns:
- the number of
Elements
in all theRoute
-
toOverviewResult
String toOverviewResult()Prints the result of theIOptimization
with 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
IEntityInvokedOperatorController
which holds information oncost advantage
of the lastOperator
etc.
-
setEntityInvokedOperatorController
Sets theIEntityInvokedOperatorController
which holds information oncost advantage
of the last usedOperator
etc.- Parameters:
opc
- the iEntityInvokedOperatorController
-
getFirstMatchingRoute
- Parameters:
node
- the iNode to look for- Returns:
- the first found
Route
containing theNode
-
getFirstMatchingRoute
Returns the firstILogicEntityRoute
in which theINode
orIPillarNode
with the inputnodeId
was found.- Parameters:
nodeId
- the string Id of theNode
to look for.- Returns:
- the
Route
in which theNode
orPillar
was found.
-
getAnchoredRoutes
List<ILogicEntityRoute> getAnchoredRoutes()Returns allILogicEntityRoute
withanchorNodes
, which are essentiallyIPillarNodes
overwriting the start or end of aRoute
.- Returns:
- the list of
Routes
withanchorNodes
-
updateJointEntityBaseValueWithRoute
Adds the value ofdistance, idle time, productive time, transit time
etc of the inputILogicEntityRoute
to theIJoinedEntityDetailController
of theIEntity
.- Parameters:
route
- the iLogicEntityRoute of which the values should be added
-
updateJointEntityBaseValueWithOwnRoutes
void updateJointEntityBaseValueWithOwnRoutes()Instantiates a newIJoinedEntityDetailController
and adds the values of allILogicEntityRoute
that were notunassigned
. -
setMultiWorkingHoursConstraintController
Sets theIMultiWorkingHoursConstraintController
which controls the costs for violatingIConstraints
orIWorkingHours
.- Parameters:
controller
- the iMultiWorkingHoursConstraintController to set
-
getMultiWorkingHoursConstraintController
IMultiWorkingHoursConstraintController getMultiWorkingHoursConstraintController()Gets theIMultiWorkingHoursConstraintController
which controls the costs for violatingIConstraints
orIWorkingHours
.- Returns:
- the
IMultiWorkingHoursConstraintController
-
setIsUnassessed
void setIsUnassessed(boolean isUnassessed) Sets theunassessed
status.Being marked as
unassessed
means that thisObject
will have to go throughassessment
again. For complete solutions theILogicEntityRoutes
and allIEntities
have to be assessed. When anINode
is shifted from oneRoute
to another by anIOperator
the respectiveRoutes
andEntity
need to be marked asunassessed
in order to getassessed
again updating theircosts
since they might have changed. AnEntity
also needs to be set asunassessed
whensetIsRequestAllRoutesElementDetails(boolean)
is set totrue
. By doing this theRoutes
will automatically be set tounassessed
since they need to go through a newassessment
in 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)
-