Class Entity
- All Implemented Interfaces:
IEntity
,Serializable
,Cloneable
- See Also:
-
Constructor Summary
-
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 controller) 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
.
-
Constructor Details
-
Entity
public Entity()
-
-
Method Details
-
getBuildTimeStamp
public long getBuildTimeStamp()- Specified by:
getBuildTimeStamp
in interfaceIEntity
-
setIsUnassessed
public void setIsUnassessed(boolean isUnassessed) Description copied from interface:IEntity
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
whenIEntity.setIsRequestAllRoutesElementDetails(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
- Specified by:
setIsUnassessed
in interfaceIEntity
- Parameters:
isUnassessed
- the boolean to set
-
isUnassessed
public boolean isUnassessed()Description copied from interface:IEntity
- Specified by:
isUnassessed
in interfaceIEntity
- Returns:
- the set
value
-
setRelationShipController
Description copied from interface:IEntity
- Specified by:
setRelationShipController
in interfaceIEntity
- Parameters:
controller
- the iRelationshipController to set
-
getRelationshipController
Description copied from interface:IEntity
- Specified by:
getRelationshipController
in interfaceIEntity
- Returns:
- details on the relationship
-
setMultiWorkingHoursConstraintController
public void setMultiWorkingHoursConstraintController(IMultiWorkingHoursConstraintController controller) Description copied from interface:IEntity
Sets theIMultiWorkingHoursConstraintController
which controls the costs for violatingIConstraints
orIWorkingHours
.- Specified by:
setMultiWorkingHoursConstraintController
in interfaceIEntity
- Parameters:
controller
- the iMultiWorkingHoursConstraintController to set
-
getMultiWorkingHoursConstraintController
Description copied from interface:IEntity
Gets theIMultiWorkingHoursConstraintController
which controls the costs for violatingIConstraints
orIWorkingHours
.- Specified by:
getMultiWorkingHoursConstraintController
in interfaceIEntity
- Returns:
- the
IMultiWorkingHoursConstraintController
-
setJoinedCost
public void setJoinedCost(double cost) Description copied from interface:IEntity
Sets thejoined cost
which is the accumulated sum ofinternal cost
of allIlogicEntityRoutes
of theIEntity
.- Specified by:
setJoinedCost
in interfaceIEntity
- Parameters:
cost
- the double internal costs of the wholeIEntity
-
getJoinedCost
public double getJoinedCost()Description copied from interface:IEntity
Gets thejoined cost
which is the accumulated sum ofinternal cost
of allIlogicEntityRoutes
of theIEntity
.- Specified by:
getJoinedCost
in interfaceIEntity
- Returns:
- the total of internal costs of the
IEntity
-
getEntityCostAndViolationController
Description copied from interface:IEntity
- Specified by:
getEntityCostAndViolationController
in interfaceIEntity
- Returns:
- the
IEntityCostAndViolationController
-
setEntityCostAndViolationController
Description copied from interface:IEntity
- Specified by:
setEntityCostAndViolationController
in interfaceIEntity
- Parameters:
controller
- the iEntityCostAndViolationController
-
addRoute
Description copied from interface:IEntity
Adds anILogicEntityRoute
. -
addRoute
Description copied from interface:IEntity
Adds aILogicEntityRoute
at theindex
position, shifting theRoute
at that position to the right and updating allindexes
-
removeRoute
Description copied from interface:IEntity
Removes anILogicEntityRoute
from anIEntity
.- Specified by:
removeRoute
in interfaceIEntity
- Parameters:
remRoute
- the route to remove
-
removeRoute
public void removeRoute(int index) Description copied from interface:IEntity
- Specified by:
removeRoute
in interfaceIEntity
- Parameters:
index
- the int index
-
setIsRequestAllRoutesElementDetails
public void setIsRequestAllRoutesElementDetails(boolean requestAllElementDetails) Description copied from interface:IEntity
Sets theresultrequested
value of allILogicEntityRoutes
. If set totrue
theILogicRouteElementDetailItems
are getting saved.- Specified by:
setIsRequestAllRoutesElementDetails
in interfaceIEntity
- Parameters:
requestAllElementDetails
- the boolean to set
-
getRouteIterator
Description copied from interface:IEntity
Gets the routeiterator
.- Specified by:
getRouteIterator
in interfaceIEntity
- Returns:
- the route iterator
-
getRouteCount
public int getRouteCount()Description copied from interface:IEntity
Gets the current number ofRoutes
.- Specified by:
getRouteCount
in interfaceIEntity
- Returns:
- the route count
- See Also:
-
getRoute
Description copied from interface:IEntity
Gets theILogicEntityRoute
according to theindex
. -
setRoutes
Description copied from interface:IEntity
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. -
getTotalRoutesOptimizableElementsCount
public int getTotalRoutesOptimizableElementsCount()Description copied from interface:IEntity
Gets the total number ofIOptimizationElements
within theILogicEntityRoutes
.- Specified by:
getTotalRoutesOptimizableElementsCount
in interfaceIEntity
- Returns:
- the total route element count
-
getTotalRoutesDistinctElementsCount
public int getTotalRoutesDistinctElementsCount()Description copied from interface:IEntity
Gets the number of allIOptimizationElement
.- Specified by:
getTotalRoutesDistinctElementsCount
in interfaceIEntity
- Returns:
- the number of
Elements
in all theRoute
-
getRoutes
Description copied from interface:IEntity
Gets the wholelist
ofILogicEntityRoutes
. -
exchangeExistingRouteWithExistingRoute
public boolean exchangeExistingRouteWithExistingRoute(ILogicEntityRoute existingRouteOrg, ILogicEntityRoute existingRouteReplace) Description copied from interface:IEntity
Replaces anILogicEntityRoute
with anotherILogicEntityRoute
in all theEntities
.This is used in
lockdown
.- Specified by:
exchangeExistingRouteWithExistingRoute
in interfaceIEntity
- Parameters:
existingRouteOrg
- the iLogicEntityRoute to replaceexistingRouteReplace
- the ILogicEntityRoute that will be put in its stead- Returns:
true
if the operation was successful
-
exchangeExistingRouteWithClone
Description copied from interface:IEntity
- Specified by:
exchangeExistingRouteWithClone
in interfaceIEntity
- Parameters:
existingRoute
- the iLogicEntityRoute that is replaced with a copy- Returns:
- the cloned
ILogicEntityRoute
-
exchangeExistingRoutesWithClones
public List<ILogicEntityRoute> exchangeExistingRoutesWithClones(List<ILogicEntityRoute> existingRoutes) Description copied from interface:IEntity
- Specified by:
exchangeExistingRoutesWithClones
in interfaceIEntity
- Parameters:
existingRoutes
- the iLogicEntityRoutes that are replaced with a copy- Returns:
- the copied list of the input
-
partialCopy
Description copied from interface:IEntity
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.- Specified by:
partialCopy
in interfaceIEntity
- Parameters:
routes2BeCopied
- the iLogicEntityRoutes which are copied- Returns:
- an
Object
containing references to the originalIEntity
while the inputRoutes
are copies
-
partialCopyExchangeExistingRoute
public IEntity partialCopyExchangeExistingRoute(ILogicEntityRoute existingRouteOrg, ILogicEntityRoute existingRouteReplace) - Specified by:
partialCopyExchangeExistingRoute
in interfaceIEntity
-
copy
Description copied from interface:IEntity
Copies the currentIEntity
. -
toOverviewResult
Description copied from interface:IEntity
Prints the result of theIOptimization
with the number ofILogicEntityRoute
, number ofIOptimizationElement
, total time, distance, idle time etc.- Specified by:
toOverviewResult
in interfaceIEntity
- Returns:
- an overview of the result
-
toString
Description copied from interface:IEntity
Returns aString
representing theIEntity
object.Some information is given on the
ILogicEntityRoutes
like theproductive time
and theidle time
. -
toString
-
getJoinedDetailController
Description copied from interface:IEntity
Gets theIJoinedEntityDetailController
which is assessing the times and distances of theILogicEntityRoutes
.- Specified by:
getJoinedDetailController
in interfaceIEntity
- Returns:
- the
IJoinedEntityDetailController
-
setJoinedDetailController
Description copied from interface:IEntity
Sets theIJoinedEntityDetailController
which is assessing the times and distances of theILogicEntityRoutes
.- Specified by:
setJoinedDetailController
in interfaceIEntity
- Parameters:
joinedDetailController
- the iJoinedEntityDetailController to set
-
getRouteViolationSummaries
Description copied from interface:IEntity
- Specified by:
getRouteViolationSummaries
in interfaceIEntity
- Returns:
- the summarized IViolations
-
setEntityArranger
public void setEntityArranger(com.dna.jopt.framework.firstentitycreation.IEntityArranger entityArranger) Description copied from interface:IEntity
Sets theIEntityArranger
.- Specified by:
setEntityArranger
in interfaceIEntity
- Parameters:
entityArranger
- the iEntityArranger
-
getEntityArranger
public com.dna.jopt.framework.firstentitycreation.IEntityArranger getEntityArranger()Description copied from interface:IEntity
Gets theIEntityArranger
, responsible for creating a hard constraints freeIEntity
.- Specified by:
getEntityArranger
in interfaceIEntity
- Returns:
- the
IEntityArranger
-
getEntityInvokedOperatorController
Description copied from interface:IEntity
Gets theIEntityInvokedOperatorController
.- Specified by:
getEntityInvokedOperatorController
in interfaceIEntity
- Returns:
- the
IEntityInvokedOperatorController
which holds information oncost advantage
of the lastOperator
etc.
-
setEntityInvokedOperatorController
Description copied from interface:IEntity
Sets theIEntityInvokedOperatorController
which holds information oncost advantage
of the last usedOperator
etc.- Specified by:
setEntityInvokedOperatorController
in interfaceIEntity
- Parameters:
opc
- the iEntityInvokedOperatorController
-
updateJointEntityBaseValueWithRoute
Description copied from interface:IEntity
Adds the value ofdistance, idle time, productive time, transit time
etc of the inputILogicEntityRoute
to theIJoinedEntityDetailController
of theIEntity
.- Specified by:
updateJointEntityBaseValueWithRoute
in interfaceIEntity
- Parameters:
route
- the iLogicEntityRoute of which the values should be added
-
updateJointEntityBaseValueWithOwnRoutes
public void updateJointEntityBaseValueWithOwnRoutes()Description copied from interface:IEntity
Instantiates a newIJoinedEntityDetailController
and adds the values of allILogicEntityRoute
that were notunassigned
.- Specified by:
updateJointEntityBaseValueWithOwnRoutes
in interfaceIEntity
-
getAllEntityElements
Description copied from interface:IEntity
Gets allIOptimizationElements
of theIEntity
.- Specified by:
getAllEntityElements
in interfaceIEntity
- Returns:
- all
IOptimizationElements
-
getAllRoutesElements
Description copied from interface:IEntity
- Specified by:
getAllRoutesElements
in interfaceIEntity
- Parameters:
resourceId
- the string to search for- Returns:
- the search results containing the input
-
getResourceFirstOccurenceAbsoluteIndexMap
- Specified by:
getResourceFirstOccurenceAbsoluteIndexMap
in interfaceIEntity
-
getFirstMatchingRoute
Description copied from interface:IEntity
Returns the firstILogicEntityRoute
in which theINode
orIPillarNode
with the inputnodeId
was found.- Specified by:
getFirstMatchingRoute
in interfaceIEntity
- Parameters:
nodeId
- the string Id of theNode
to look for.- Returns:
- the
Route
in which theNode
orPillar
was found.
-
getRoutesByResource
- Specified by:
getRoutesByResource
in interfaceIEntity
-
getAnchoredRoutes
Description copied from interface:IEntity
Returns allILogicEntityRoute
withanchorNodes
, which are essentiallyIPillarNodes
overwriting the start or end of aRoute
.- Specified by:
getAnchoredRoutes
in interfaceIEntity
- Returns:
- the list of
Routes
withanchorNodes
-
getFirstMatchingRoute
Description copied from interface:IEntity
- Specified by:
getFirstMatchingRoute
in interfaceIEntity
- Parameters:
node
- the iNode to look for- Returns:
- the first found
Route
containing theNode
-
hasResource
Description copied from interface:IEntity
- Specified by:
hasResource
in interfaceIEntity
- Parameters:
resourceId
- the stringId
to search for- Returns:
true
if aResource
containing thisId
exists
-
hasNode
Description copied from interface:IEntity
-
getRoutesContainingElementId
- Specified by:
getRoutesContainingElementId
in interfaceIEntity
-
getRoutesContainingElementId
public List<ILogicEntityRoute> getRoutesContainingElementId(String elementId, boolean ignoreStartEnd) - Specified by:
getRoutesContainingElementId
in interfaceIEntity
-
getRoutesContainingElementId
public Optional<ILogicEntityRoute> getRoutesContainingElementId(String elementId, String visitor, boolean ignoreStartEnd) - Specified by:
getRoutesContainingElementId
in interfaceIEntity
-
getNoneOptimizableElements
Description copied from interface:IEntity
Gets all theIOptimizationElements
that will not be optimized anymore because they are in the past for example.- Specified by:
getNoneOptimizableElements
in interfaceIEntity
- Returns:
- the list of
noneOptimizableElements
-
getOptimizableElements
Description copied from interface:IEntity
Gets allIOptimizationElement
of allILogicEntityRoutes
.- Specified by:
getOptimizableElements
in interfaceIEntity
- Returns:
- all
optimizable Elements
-
getElement
- Specified by:
getElement
in interfaceIEntity
-
getElement
- Specified by:
getElement
in interfaceIEntity
-