Package com.dna.jopt.member.bucket.route
Class LogicEntityRoute
java.lang.Object
com.dna.jopt.member.bucket.route.LogicEntityRoute
- All Implemented Interfaces:
ILogicEntityRoute
,Serializable
,Cloneable
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
addAllToOptimizableElements
(int index, List<? extends IOptimizationElement> addList) boolean
addAllToOptimizableElements
(List<? extends IOptimizationElement> addList) boolean
void
addFlag
(LogicEntityRouteFlag flag) void
void
addOptimizableElement
(IOptimizationElement element, int index) void
addOptionalOptimizableElement
(IOptimizationElement optionalElement) void
addRoutePillar
(IPillarNode pillar) void
addRoutePillar
(IPillarNode pillar, int index) void
addRoutePillars
(List<IPillarNode> pillars) void
void
void
void
copy()
getConnectionHook
(String toId) Gets theIResource
that is visiting thisRoute
.int
long
long
getElement
(String id, boolean ignoreStartEnd) getFlags()
double
double
Gets theListIterator
for theNoneOptimizableElements
.Gets theListIterator
for theoptimizable Elements
.getOptimizableElementsSubList
(int fromIndex, int toIndex) long
long
long
long
Map<Class<? extends IQualification>,
IQualification> Returns thecurrentRouteDutyHours
of thisLogicEntityRoute
.int
getRouteOptimizableElement
(int index) int
Gets theIOptimizationElement
where theRoute
starts.long
Gets theRoute
start time in milliseconds since 01.01.1970.long
Gets theIOptimizationElement
where theRoute
will end.long
double
boolean
boolean
boolean
boolean
boolean
hasSameElementsStructure
(ILogicEntityRoute compareRoute) boolean
hasSameElementsStructureIgnorePillars
(ILogicEntityRoute compareRoute, boolean doIgnorePillars) void
void
initRouteWorkingHours
(IDutyHours fakeHours) void
invokeEntityRestrictionResult
(com.dna.jopt.assessment.costassessorrestriction.restrictionresult.IEntityRestrictionResult curResult) boolean
Returns whethergetCurrentWorkingHours()
is closed or not.boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
void
static double
metersToKilometers
(double meters) static double
metersToKilometers
(double meters, int precision) static double
millisToMinutes
(long millis) static double
millisToMinutes
(long millis, int precision) long
putEffectivePillarLatestArrivalOffset
(IPillarNode p, Long valueMillis) boolean
removeAllFromOptimizableElements
(List<? extends IOptimizationElement> removeList) boolean
removeOptimizableElement
(int index) removeRoutePillar
(int index) removeRoutePillar
(IPillarNode pillar) void
removeRoutePillars
(List<IPillarNode> pillars) void
setAdditionalRouteStartOffset
(Optional<Long> offsetMillisOpt) void
setCurrentVisitingResource
(IResource res, int workingHourIndex) void
setCurrentVisitingResourceWorkingHoursIndex
(int index) void
setEffectivePillarLatestArrivalMap
(Map<String, Long> effectivePillarLatestArrivalMap) void
setEffectivePillarLatestArrivalOffsetMap
(Map<String, Long> effectivePillarLatestArrivalOffsetMap) void
setFirstGeoElementWithinRoute
(IOptimizationElement firstGeoLocationElementWithinRoute) void
setIsInactive
(boolean isInactive) void
setIsLockedDown
(boolean isLockedDown) void
setIsScheduled
(boolean isScheduled) void
setIsUnassessed
(boolean isUnassessed) void
setLastGeoElementWithinRoute
(IOptimizationElement lastGeoLocationElementWithinRoute) void
setLastLockdownStopTime
(Optional<Long> lastLockdownStopTime) void
setLoadController
(ILoadController loadContoller) void
setRequestElementDetails
(boolean requestDetails) Setsresult requested
resulting in theILogicRouteElementDetailItem
being saved and being accessable afterwards.void
setRouteClusterController
(IClusterController routeClusterController) void
void
setRouteId
(int routeId) void
void
setRouteOptimizableElements
(List<IOptimizationElement> elements) Sets theIOptimizationElements
.This method should NOT used directly only together with copy.void
void
setRoutePillars
(List<IPillarNode> pillars) void
setRouteStart
(IOptimizationElement roueStart) SetsIOptimizationElement
where the route will start.void
setRouteStartTime
(long routeStartTime) void
setRouteStopTime
(long routeStopTime) void
setRouteTermination
(IOptimizationElement roueTermination) Sets theIOptimizationElement
where theRoute
will end.toString()
-
Constructor Details
-
LogicEntityRoute
public LogicEntityRoute()
-
-
Method Details
-
getLoadController
- Specified by:
getLoadController
in interfaceILogicEntityRoute
-
setLoadController
- Specified by:
setLoadController
in interfaceILogicEntityRoute
-
getRouteClusterController
- Specified by:
getRouteClusterController
in interfaceILogicEntityRoute
-
setRouteClusterController
- Specified by:
setRouteClusterController
in interfaceILogicEntityRoute
-
hasOverriddenRouteStart
public boolean hasOverriddenRouteStart()- Specified by:
hasOverriddenRouteStart
in interfaceILogicEntityRoute
-
hasOverriddenRouteTermination
public boolean hasOverriddenRouteTermination()- Specified by:
hasOverriddenRouteTermination
in interfaceILogicEntityRoute
-
initRouteWorkingHours
public void initRouteWorkingHours()- Specified by:
initRouteWorkingHours
in interfaceILogicEntityRoute
-
initRouteWorkingHours
- Specified by:
initRouteWorkingHours
in interfaceILogicEntityRoute
-
isClosedRoute
public boolean isClosedRoute()Description copied from interface:ILogicEntityRoute
Returns whethergetCurrentWorkingHours()
is closed or not.- Specified by:
isClosedRoute
in interfaceILogicEntityRoute
- Returns:
- boolean, default value
false
. Returnstrue
ifIWorkingHours.isClosedRoute()
has been set totrue
by usingIWorkingHours.setIsClosedRoute(boolean)
.
-
getRouteDutyHours
Description copied from interface:ILogicEntityRoute
Returns thecurrentRouteDutyHours
of thisLogicEntityRoute
.- Specified by:
getRouteDutyHours
in interfaceILogicEntityRoute
- Returns:
- the
currentRouteDutyHours
-
setFirstGeoElementWithinRoute
- Specified by:
setFirstGeoElementWithinRoute
in interfaceILogicEntityRoute
-
getFirstGeoElementWithinRoute
- Specified by:
getFirstGeoElementWithinRoute
in interfaceILogicEntityRoute
-
setLastGeoElementWithinRoute
- Specified by:
setLastGeoElementWithinRoute
in interfaceILogicEntityRoute
-
getLastGeoElementWithinRoute
- Specified by:
getLastGeoElementWithinRoute
in interfaceILogicEntityRoute
-
setRouteStart
Description copied from interface:ILogicEntityRoute
SetsIOptimizationElement
where the route will start.- Specified by:
setRouteStart
in interfaceILogicEntityRoute
- Parameters:
roueStart
- the iOptimizationElement where the route has to start
-
getRouteStart
Description copied from interface:ILogicEntityRoute
Gets theIOptimizationElement
where theRoute
starts.- Specified by:
getRouteStart
in interfaceILogicEntityRoute
- Returns:
- the start of the
Route
-
setRouteTermination
Description copied from interface:ILogicEntityRoute
Sets theIOptimizationElement
where theRoute
will end.- Specified by:
setRouteTermination
in interfaceILogicEntityRoute
- Parameters:
roueTermination
- the iOptimizationElement
-
getRouteTermination
Description copied from interface:ILogicEntityRoute
Gets theIOptimizationElement
where theRoute
will end.If
Route
termination has not been overwritten it will be at the location of theIResource
or at anone night stay Node
. IfRoute termination
has been overwritten it will be at theanchorNode
.- Specified by:
getRouteTermination
in interfaceILogicEntityRoute
- Returns:
- the
Element
where theRoute
terminates
-
getOptimizableElementIterator
Description copied from interface:ILogicEntityRoute
Gets theListIterator
for theoptimizable Elements
.- Specified by:
getOptimizableElementIterator
in interfaceILogicEntityRoute
- Returns:
- the iterator
-
getNoneOptimizableElementIterator
Description copied from interface:ILogicEntityRoute
Gets theListIterator
for theNoneOptimizableElements
.- Specified by:
getNoneOptimizableElementIterator
in interfaceILogicEntityRoute
- Returns:
- the iterator
-
addOptionalOptimizableElement
- Specified by:
addOptionalOptimizableElement
in interfaceILogicEntityRoute
-
addAllToOptionalOptimizableElements
- Specified by:
addAllToOptionalOptimizableElements
in interfaceILogicEntityRoute
-
setRouteOptionalOptimizableElements
- Specified by:
setRouteOptionalOptimizableElements
in interfaceILogicEntityRoute
-
getOptimizableElementsSubList
- Specified by:
getOptimizableElementsSubList
in interfaceILogicEntityRoute
-
removeAllFromOptimizableElements
- Specified by:
removeAllFromOptimizableElements
in interfaceILogicEntityRoute
-
removeAllFromOptimizableElementsInlcudingSubsequentNodes
public boolean removeAllFromOptimizableElementsInlcudingSubsequentNodes(List<IOptimizationElement> removeList) - Specified by:
removeAllFromOptimizableElementsInlcudingSubsequentNodes
in interfaceILogicEntityRoute
-
clearOptimizableElements
public void clearOptimizableElements()- Specified by:
clearOptimizableElements
in interfaceILogicEntityRoute
-
clearRoutePillars
public void clearRoutePillars()- Specified by:
clearRoutePillars
in interfaceILogicEntityRoute
-
clearNoneOptimizableElements
public void clearNoneOptimizableElements()- Specified by:
clearNoneOptimizableElements
in interfaceILogicEntityRoute
-
clearOptionalOptimizableElements
public void clearOptionalOptimizableElements()- Specified by:
clearOptionalOptimizableElements
in interfaceILogicEntityRoute
-
addAllToOptimizableElements
- Specified by:
addAllToOptimizableElements
in interfaceILogicEntityRoute
-
addAllToNoneOptimizableElements
- Specified by:
addAllToNoneOptimizableElements
in interfaceILogicEntityRoute
-
addAllToOptimizableElements
- Specified by:
addAllToOptimizableElements
in interfaceILogicEntityRoute
-
getRouteOptimizableElementCount
public int getRouteOptimizableElementCount()- Specified by:
getRouteOptimizableElementCount
in interfaceILogicEntityRoute
-
invokeEntityRestrictionResult
public void invokeEntityRestrictionResult(com.dna.jopt.assessment.costassessorrestriction.restrictionresult.IEntityRestrictionResult curResult) -
setCurrentVisitingResourceWorkingHoursIndex
public void setCurrentVisitingResourceWorkingHoursIndex(int index) - Specified by:
setCurrentVisitingResourceWorkingHoursIndex
in interfaceILogicEntityRoute
-
markAsToBeRemoved
public void markAsToBeRemoved()- Specified by:
markAsToBeRemoved
in interfaceILogicEntityRoute
-
isMarkedToBeRemoved
public boolean isMarkedToBeRemoved()- Specified by:
isMarkedToBeRemoved
in interfaceILogicEntityRoute
-
getCurrentVisitingResourceWorkingHoursIndex
public int getCurrentVisitingResourceWorkingHoursIndex()Description copied from interface:ILogicEntityRoute
- Specified by:
getCurrentVisitingResourceWorkingHoursIndex
in interfaceILogicEntityRoute
- Returns:
- the index
-
setRouteStartTime
public void setRouteStartTime(long routeStartTime) -
getRouteStartShiftMillisHook
- Specified by:
getRouteStartShiftMillisHook
in interfaceILogicEntityRoute
-
getConnectionHook
- Specified by:
getConnectionHook
in interfaceILogicEntityRoute
-
setRouteStopTime
public void setRouteStopTime(long routeStopTime) -
getRouteStartTime
public long getRouteStartTime()Description copied from interface:ILogicEntityRoute
Gets theRoute
start time in milliseconds since 01.01.1970.- Specified by:
getRouteStartTime
in interfaceILogicEntityRoute
- Returns:
- the milliseconds since
Route
start
-
getRouteStopTime
public long getRouteStopTime()- Specified by:
getRouteStopTime
in interfaceILogicEntityRoute
-
setEffectivePillarLatestArrivalMap
- Specified by:
setEffectivePillarLatestArrivalMap
in interfaceILogicEntityRoute
-
setEffectivePillarLatestArrivalOffsetMap
public void setEffectivePillarLatestArrivalOffsetMap(Map<String, Long> effectivePillarLatestArrivalOffsetMap) - Specified by:
setEffectivePillarLatestArrivalOffsetMap
in interfaceILogicEntityRoute
-
getEffectivePillarLatestArrivalMap
- Specified by:
getEffectivePillarLatestArrivalMap
in interfaceILogicEntityRoute
-
getEffectivePillarLatestArrivalOffsetMap
- Specified by:
getEffectivePillarLatestArrivalOffsetMap
in interfaceILogicEntityRoute
-
putEffectivePillarLatestArrivalOffset
- Specified by:
putEffectivePillarLatestArrivalOffset
in interfaceILogicEntityRoute
-
getPillarEffectiveLatestArrivalMinusStartMillis
- Specified by:
getPillarEffectiveLatestArrivalMinusStartMillis
in interfaceILogicEntityRoute
-
getPillarLatestEffectiveOffsetArrival
- Specified by:
getPillarLatestEffectiveOffsetArrival
in interfaceILogicEntityRoute
-
getPillarLatestEffectiveArrivalOffsetCorrected
- Specified by:
getPillarLatestEffectiveArrivalOffsetCorrected
in interfaceILogicEntityRoute
-
getPillarLatestEffectiveArrival
- Specified by:
getPillarLatestEffectiveArrival
in interfaceILogicEntityRoute
-
getEffectiveRouteStartTime
public long getEffectiveRouteStartTime()- Specified by:
getEffectiveRouteStartTime
in interfaceILogicEntityRoute
-
getEffectiveRouteStopTime
public long getEffectiveRouteStopTime()- Specified by:
getEffectiveRouteStopTime
in interfaceILogicEntityRoute
-
setCurrentVisitingResource
- Specified by:
setCurrentVisitingResource
in interfaceILogicEntityRoute
-
getCurrentVisitingResource
Description copied from interface:ILogicEntityRoute
Gets theIResource
that is visiting thisRoute
.- Specified by:
getCurrentVisitingResource
in interfaceILogicEntityRoute
- Returns:
- the object
IResource
-
getRouteCostAndViolationController
- Specified by:
getRouteCostAndViolationController
in interfaceILogicEntityRoute
-
setRouteCostAndViolationController
- Specified by:
setRouteCostAndViolationController
in interfaceILogicEntityRoute
-
getRouteElementsDetailController
- Specified by:
getRouteElementsDetailController
in interfaceILogicEntityRoute
-
getRouteId
public int getRouteId()- Specified by:
getRouteId
in interfaceILogicEntityRoute
-
setRouteId
public void setRouteId(int routeId) - Specified by:
setRouteId
in interfaceILogicEntityRoute
-
getRouteOptimizableElement
Description copied from interface:ILogicEntityRoute
- Specified by:
getRouteOptimizableElement
in interfaceILogicEntityRoute
- Parameters:
index
- the int index- Returns:
- the Element
-
getRouteOptimizableElements
Description copied from interface:ILogicEntityRoute
- Specified by:
getRouteOptimizableElements
in interfaceILogicEntityRoute
- Returns:
- the list of
Elements
-
getRouteOptimizableElementsIncludingSubsequentNodes
- Specified by:
getRouteOptimizableElementsIncludingSubsequentNodes
in interfaceILogicEntityRoute
-
getRouteNoneOptimizableElements
- Specified by:
getRouteNoneOptimizableElements
in interfaceILogicEntityRoute
-
getRouteOptionalOptimizableElements
- Specified by:
getRouteOptionalOptimizableElements
in interfaceILogicEntityRoute
-
addOptimizableElement
- Specified by:
addOptimizableElement
in interfaceILogicEntityRoute
-
addOptimizableElement
Description copied from interface:ILogicEntityRoute
- Specified by:
addOptimizableElement
in interfaceILogicEntityRoute
- Parameters:
element
- iOptimizationElement to add
-
removeOptimizableElement
- Specified by:
removeOptimizableElement
in interfaceILogicEntityRoute
-
removeOptimizableElement
- Specified by:
removeOptimizableElement
in interfaceILogicEntityRoute
-
setRequestElementDetails
public void setRequestElementDetails(boolean requestDetails) Description copied from interface:ILogicEntityRoute
Setsresult requested
resulting in theILogicRouteElementDetailItem
being saved and being accessable afterwards. This will seen by the cost assessor. After one request theILogicEntityRoute
automatically is set back to no request.- Specified by:
setRequestElementDetails
in interfaceILogicEntityRoute
- Parameters:
requestDetails
- the boolean whether theILogicRouteElementDetailItem
should be saved
-
isRequestElementDetails
public boolean isRequestElementDetails()- Specified by:
isRequestElementDetails
in interfaceILogicEntityRoute
-
setIsUnassessed
public void setIsUnassessed(boolean isUnassessed) - Specified by:
setIsUnassessed
in interfaceILogicEntityRoute
-
getLastLockdownStopTime
- Specified by:
getLastLockdownStopTime
in interfaceILogicEntityRoute
-
setLastLockdownStopTime
- Specified by:
setLastLockdownStopTime
in interfaceILogicEntityRoute
-
setAdditionalRouteStartOffset
- Specified by:
setAdditionalRouteStartOffset
in interfaceILogicEntityRoute
-
getAdditionalRouteStartOffset
- Specified by:
getAdditionalRouteStartOffset
in interfaceILogicEntityRoute
-
isUnassessed
public boolean isUnassessed()- Specified by:
isUnassessed
in interfaceILogicEntityRoute
-
copy
- Specified by:
copy
in interfaceILogicEntityRoute
-
setRouteOptimizableElements
Description copied from interface:ILogicEntityRoute
Sets theIOptimizationElements
.This method should NOT used directly only together with copy.- Specified by:
setRouteOptimizableElements
in interfaceILogicEntityRoute
- Parameters:
elements
- the new route elements
-
setRouteNoneOptimizableElements
- Specified by:
setRouteNoneOptimizableElements
in interfaceILogicEntityRoute
-
getJoinedDetailController
- Specified by:
getJoinedDetailController
in interfaceILogicEntityRoute
-
isLastOptimizableElementInRoute
- Specified by:
isLastOptimizableElementInRoute
in interfaceILogicEntityRoute
-
isFirstOptimizableElementInRoute
- Specified by:
isFirstOptimizableElementInRoute
in interfaceILogicEntityRoute
-
addRoutePillar
- Specified by:
addRoutePillar
in interfaceILogicEntityRoute
-
addRoutePillar
- Specified by:
addRoutePillar
in interfaceILogicEntityRoute
-
removeRoutePillar
- Specified by:
removeRoutePillar
in interfaceILogicEntityRoute
-
removeRoutePillar
- Specified by:
removeRoutePillar
in interfaceILogicEntityRoute
-
removeRoutePillars
- Specified by:
removeRoutePillars
in interfaceILogicEntityRoute
-
addRoutePillars
- Specified by:
addRoutePillars
in interfaceILogicEntityRoute
-
setRoutePillars
- Specified by:
setRoutePillars
in interfaceILogicEntityRoute
-
hasRoutePillars
public boolean hasRoutePillars()- Specified by:
hasRoutePillars
in interfaceILogicEntityRoute
-
getRoutePillars
- Specified by:
getRoutePillars
in interfaceILogicEntityRoute
-
getRouteTimeMillis
public long getRouteTimeMillis()- Specified by:
getRouteTimeMillis
in interfaceILogicEntityRoute
-
getTotalRouteDistanceMeter
public double getTotalRouteDistanceMeter()- Specified by:
getTotalRouteDistanceMeter
in interfaceILogicEntityRoute
-
toString
- Specified by:
toString
in interfaceILogicEntityRoute
- Overrides:
toString
in classObject
-
millisToMinutes
public static double millisToMinutes(long millis) -
metersToKilometers
public static double metersToKilometers(double meters) -
millisToMinutes
public static double millisToMinutes(long millis, int precision) -
metersToKilometers
public static double metersToKilometers(double meters, int precision) -
isFinalized
public boolean isFinalized()- Specified by:
isFinalized
in interfaceILogicEntityRoute
-
setIsInactive
public void setIsInactive(boolean isInactive) - Specified by:
setIsInactive
in interfaceILogicEntityRoute
-
isInactive
public boolean isInactive()- Specified by:
isInactive
in interfaceILogicEntityRoute
-
setIsLockedDown
public void setIsLockedDown(boolean isLockedDown) - Specified by:
setIsLockedDown
in interfaceILogicEntityRoute
-
isLockedDown
public boolean isLockedDown()- Specified by:
isLockedDown
in interfaceILogicEntityRoute
-
getMaxWorkingHours
public double getMaxWorkingHours()- Specified by:
getMaxWorkingHours
in interfaceILogicEntityRoute
-
getMaxDistanceKilometer
public double getMaxDistanceKilometer()- Specified by:
getMaxDistanceKilometer
in interfaceILogicEntityRoute
-
isReductionTimeOnlyUsedForDriving
- Specified by:
isReductionTimeOnlyUsedForDriving
in interfaceILogicEntityRoute
-
isReductionTimeOnlyUsedForDrivingPillar
- Specified by:
isReductionTimeOnlyUsedForDrivingPillar
in interfaceILogicEntityRoute
-
isReductionTimeIncludedInWorkingTime
- Specified by:
isReductionTimeIncludedInWorkingTime
in interfaceILogicEntityRoute
-
getMaxRouteStartReductionTimeMillis
- Specified by:
getMaxRouteStartReductionTimeMillis
in interfaceILogicEntityRoute
-
getQualifications
- Specified by:
getQualifications
in interfaceILogicEntityRoute
-
getMaxRouteStartReductionTimeMillisPillar
- Specified by:
getMaxRouteStartReductionTimeMillisPillar
in interfaceILogicEntityRoute
-
getFlexTimeMillis
- Specified by:
getFlexTimeMillis
in interfaceILogicEntityRoute
-
getMaxFreePostWorkDrivingTerminationTimeMillis
- Specified by:
getMaxFreePostWorkDrivingTerminationTimeMillis
in interfaceILogicEntityRoute
-
isOnlyApplyFreePostWorkDrivingOnOvertime
- Specified by:
isOnlyApplyFreePostWorkDrivingOnOvertime
in interfaceILogicEntityRoute
-
getMaxPillarAfterHoursTime
- Specified by:
getMaxPillarAfterHoursTime
in interfaceILogicEntityRoute
-
hasSameElementsStructureIgnorePillars
public boolean hasSameElementsStructureIgnorePillars(ILogicEntityRoute compareRoute, boolean doIgnorePillars) - Specified by:
hasSameElementsStructureIgnorePillars
in interfaceILogicEntityRoute
-
hasSameElementsStructure
- Specified by:
hasSameElementsStructure
in interfaceILogicEntityRoute
-
setIsScheduled
public void setIsScheduled(boolean isScheduled) - Specified by:
setIsScheduled
in interfaceILogicEntityRoute
-
isScheduled
public boolean isScheduled()- Specified by:
isScheduled
in interfaceILogicEntityRoute
-
addFlag
- Specified by:
addFlag
in interfaceILogicEntityRoute
-
getFlags
- Specified by:
getFlags
in interfaceILogicEntityRoute
-
getAllElements
- Specified by:
getAllElements
in interfaceILogicEntityRoute
-
getAllNodes
- Specified by:
getAllNodes
in interfaceILogicEntityRoute
-
hasNode
- Specified by:
hasNode
in interfaceILogicEntityRoute
-
getResourceDepot
- Specified by:
getResourceDepot
in interfaceILogicEntityRoute
-
getElement
- Specified by:
getElement
in interfaceILogicEntityRoute
-