Class InducedIdleEventNode
java.lang.Object
com.dna.jopt.member.unit.AbstractOptimizationElement
com.dna.jopt.member.unit.node.AbstractNode
com.dna.jopt.member.unit.node.event.EventNode
com.dna.jopt.member.unit.node.event.InducedIdleEventNode
- All Implemented Interfaces:
IOptimizationElement, INode, Serializable
This class
- Since:
- 31/01/2020
- Version:
- 31/01/2020
- Author:
- DNA
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classThe numbers of theInducedIdleEventNodescreated in one task of a parallel step, for example one task of a generation of the genetic evolution.Nested classes/interfaces inherited from class AbstractNode
AbstractNode.JointVisitDurationInvocationMethod, AbstractNode.JointVisitDurationTriggerNested classes/interfaces inherited from interface IOptimizationElement
IOptimizationElement.OptimizationElementFlavour -
Field Summary
FieldsFields inherited from class AbstractOptimizationElement
dutyHours -
Constructor Summary
ConstructorsConstructorDescriptionInducedIdleEventNode(INode2NodeRelation rel, IOpeningHours openingHour, Duration duration, boolean isCausingIdleTimeCost) The constructor of anInducedIdleEventNodeto add to theNode IDtheRelationsto anotherNode.InducedIdleEventNode(String nodeId, IOpeningHours openingHour, Duration duration, boolean isCausingIdleTimeCost) The constructor of anInducedIdleEventNode. -
Method Summary
Modifier and TypeMethodDescriptionGets theTimeStampof the creation of theInducedIdleEventNodeas created bySystem.currentTimeMillis().getId()Gets theID: theIDgiven to the constructor, the time it was created and its number, for exampleIDLE_EVENT_RELATION_(A -> B) CREATED::<creationTimeStamp> SEQ::<number>.Gets theIDof theMasterNode.static StringgetPartialNodeId(String masterNodeId, String relatedNodeId) Gets theNode IDand adds themasterNodeIdand therelatedNodeId.Gets theIDof theRelatedNode.static InducedIdleEventNodegetShrinkedCopy(InducedIdleEventNode baseEvent, long shinkMillis, long safetyAdditionalDuration, boolean isCausingIdleTimeCost) Gets a copy of the inputNodewhere the inputshinkMillisandsafetyAdditionalDurationare substracted or added respectively from/to the end of thetimeWindowof theOpeningHoursin seconds.booleanChecks for route dependent visit duration.static InducedIdleEventNodeofExistingId(String existingId, IOpeningHours openingHour, Duration duration, boolean isCausingIdleTimeCost) Creates anInducedIdleEventNodethat keeps an existingID, for example theIDof a node read from a JSON snapshot, so the routes of the snapshot still find it.voidsetCreationTimeStamp(long creationTimeStamp) Sets the input in the form ofSystem.currentTimeMillis()as theTimeStampwhen theInducedIdleEventNodewas created.voidsetMasterNodeId(String connectedMasterNodeId) Sets the inputIDas theMasterNode.voidsetRelatedNodeId(String connectedRelatedNodeId) Sets the inputIDas theRelatedNodeMethods inherited from class EventNode
getFlavour, hasRealGeoLocation, isPartialExchangeIdleForDrivingTime, isPillarNode, setIsPartialExchangeIdleForDrivingTimeMethods inherited from class AbstractNode
addConstraint, addNode2NodeRelation, addPriorSubNode, addPriorSubNodes, addQualification, addSubsequentSubNode, addSubsequentSubNodes, addViolation, decrementCurrentAutoFilterProtectedExecutions, detachNodeRelations, detachResourceConstraints, detachResourceConstraints, equals, getAutoFilterViolationCollector, getBaseJointVisitDuration, getBaseJointVisitDurationMillis, getBaseVisitDuration, getBaseVisitDurationMillis, getConstraints, getCurrentLeftAutoFilterProtectedExecutions, getDutyHours, getFirstNodeInRouteImportance, getFixCost, getImportance, getIndividualOfferedNodeMultiplier, getJointVisitDuration, getJointVisitDurationInvocationMethod, getJointVisitDurationMillis, getJointVisitDurationTrigger, getLastKnownAttachedAndRemovedResIds, getLastNodeInRouteImportance, getLoad, getLockdownTime, getMinVisitDuration, getMinVisitDurationMillis, getNode2NodeRelations, getNodeColor, getNodeDepot, getNodeId, getOriginalDutyHours, getPriorSubNodes, getQualifications, getStayAtStartDuration, getSubsequentSubNodes, getTempImplausibleScore, getTotalLoadDimension, getUnloadAllDimension, getViolations, getVisitDurationMillis, getVisitDurationMillisWithOptionalModFunction, hasFullJobLevelRelations, hasGeneralAutoFilterProtection, hashCode, hasRelations, invokeDetachedResourceConstraints, isAllowMoveToReduceFlexTime, isAutoFilterProtected, isCausingIdleTimeCost, isDutyHoursIncludesVisitDuration, isEnabledSubNodes, isIgnoreNodeWithZeroDuration, isIgnoreOnZeroLoad, isOfferedNode, isOnBlackList, isOptimizable, isOptional, isReturnStart, isStayNode, isUnassigned, isUnloadAll, isUnlocatedHubConnectionTime, isUseJointVisitDuration, isWaitOnEarlyArrival, isWaitOnEarlyArrivalFirstNode, isWorkNode, putResourceToBlacklist, removeConstraint, removeNode2NodeRelations, resetDutyHoursTempActivation, resetLockdownTime, resetPriorSubNodes, resetSubsequentSubNodes, setAllowMoveToReduceFlexTime, setAutoFilterConstraints, setConstraints, setFirstNodeInRouteImportance, setFixCost, setHasGeneralAutoFilterProtection, setHasRouteDependentVisitDuration, setIgnoreNodeWithZeroDuration, setIgnoreOnZeroLoad, setImportance, setIndividualOfferedNodeMultiplier, setIsCausingIdleTimeCost, setIsDutyHoursIncludesVisitDuration, setIsEnabledSubNodes, setIsOfferedNode, setIsOptional, setIsReturnStart, setIsStayNode, setIsUnlocatedHubConnectionTime, setIsWorkNode, setJointVisitDuration, setJointVisitDurationInvocationMethod, setJointVisitDurationTrigger, setLastNodeInRouteImportance, setLoad, setLockdownTime, setMinAutoFilterProtectedExecutions, setMinimalVisitDuration, setNodeColor, setNodeDepot, setNodeId, setOptimizable, setOptimizable, setUnassigned, setUnloadAll, setUnloadAllDimension, setVisitDuration, setVisitDurationMillis, setWaitOnEarlyArrival, setWaitOnEarlyArrivalFirstNode, tempIncreaseImplausibleScore, tempSetActiveDutyHours, toStringMethods inherited from class AbstractOptimizationElement
forceSetId, getConstraintAliasId, getDistMatrixId, getExtraInfo, getLatitude, getLocationId, getLongitude, getNodeConnection, getNodeConnectionKeySet, getNodeConnections, getPosition, getPreferredHoursInteractionController, putNodeConnection, putNodeConnectionFromElement, removeNodeConnection, setConstraintAliasId, setDistMatrixId, setDutyHours, setExtraInfo, setId, setLatitude, setLocationId, setLongitude, setPositionMethods inherited from interface IOptimizationElement
forceSetId, getConstraintAliasId, getDistMatrixId, getExtraInfo, getLatitude, getLocationId, getLongitude, getNodeConnection, getNodeConnectionKeySet, getNodeConnections, getPosition, getPreferredHoursInteractionController, putNodeConnection, putNodeConnectionFromElement, removeNodeConnection, setConstraintAliasId, setDistMatrixId, setDutyHours, setExtraInfo, setId, setLatitude, setLocationId, setLongitude, setPosition
-
Field Details
-
RELATED_ELEMENT_INDEX
public static final int RELATED_ELEMENT_INDEX- See Also:
-
-
Constructor Details
-
InducedIdleEventNode
public InducedIdleEventNode(String nodeId, IOpeningHours openingHour, Duration duration, boolean isCausingIdleTimeCost) The constructor of anInducedIdleEventNode.The
IDis the inputnodeIdplus the time of creation and a number that no otherInducedIdleEventNodeof the JVM gets (seegetId()).- Parameters:
nodeId- the string ID of theNodeopeningHour- the iOpeningHourduration- the duration of theidle time
-
InducedIdleEventNode
public InducedIdleEventNode(INode2NodeRelation rel, IOpeningHours openingHour, Duration duration, boolean isCausingIdleTimeCost) The constructor of anInducedIdleEventNodeto add to theNode IDtheRelationsto anotherNode.- Parameters:
rel- the iNode2NodeRelationopeningHour- the iOpeningHourduration- the duration of theidle time
-
-
Method Details
-
ofExistingId
public static InducedIdleEventNode ofExistingId(String existingId, IOpeningHours openingHour, Duration duration, boolean isCausingIdleTimeCost) Creates anInducedIdleEventNodethat keeps an existingID, for example theIDof a node read from a JSON snapshot, so the routes of the snapshot still find it. NoInducedIdleEventNodecreated later gets thisID. The creation time stamp is not set (seesetCreationTimeStamp(long)).- Parameters:
existingId- the completeIDof the nodeopeningHour- the iOpeningHourduration- the duration of theidle timeisCausingIdleTimeCost- whether theidle timecauses cost- Returns:
- the node with the existing
ID
-
getPartialNodeId
Gets theNode IDand adds themasterNodeIdand therelatedNodeId.Used in InducedIdleEventNode(INode2NodeRelation, IOpeningHours, Duration) to add the
IDsof theMasterNodeand theRelatedNodeto the to theIDof theInducedIdleEventNode- Parameters:
masterNodeId- the stringIDof theMasterNoderelatedNodeId- the stringIDof theRelatedNode- Returns:
- the
IDin conjunction with theMaster-andRelatedNode ID
-
getId
Gets theID: theIDgiven to the constructor, the time it was created and its number, for exampleIDLE_EVENT_RELATION_(A -> B) CREATED::<creationTimeStamp> SEQ::<number>. The number is unique in the JVM: a number of the sequence, or inside anInducedIdleEventNode.IdScopethe number of the scope and the count in it (SEQ::<number>.<count>).A node that keeps an existing
ID(seeofExistingId(String, IOpeningHours, Duration, boolean)) returns thatIDunchanged.- Specified by:
getIdin interfaceIOptimizationElement- Overrides:
getIdin classAbstractOptimizationElement- Returns:
- the
ID String
-
getShrinkedCopy
public static InducedIdleEventNode getShrinkedCopy(InducedIdleEventNode baseEvent, long shinkMillis, long safetyAdditionalDuration, boolean isCausingIdleTimeCost) Gets a copy of the inputNodewhere the inputshinkMillisandsafetyAdditionalDurationare substracted or added respectively from/to the end of thetimeWindowof theOpeningHoursin seconds.- Parameters:
baseEvent- the node to shrinkshinkMillis- the long milliseconds to substract from the end of theOpeningHourssafetyAdditionalDuration- the long milliseconds to add to the end of theOpeningHours- Returns:
- a copy of the
Nodewith the changedTimeWindow
-
setMasterNodeId
Sets the inputIDas theMasterNode.This method does not actually set up
Relationsbut only sets the inputStringin theclass variable- Parameters:
connectedMasterNodeId- the stringIDof theMasterNode
-
setRelatedNodeId
Sets the inputIDas theRelatedNodeThis method does not actually set up
Relationsbut only sets the inputStringin theclass variable- Parameters:
connectedRelatedNodeId- the stringIDof theMasterNode
-
setCreationTimeStamp
public void setCreationTimeStamp(long creationTimeStamp) Sets the input in the form ofSystem.currentTimeMillis()as theTimeStampwhen theInducedIdleEventNodewas created.The
IDof a created node shows the newTimeStampand keeps its number. A node with an existingIDkeeps thatID.- Parameters:
creationTimeStamp- the longTimeStamp
-
getMasterNodeId
-
getRelatedNodeId
-
getCreationTimeStamp
Gets theTimeStampof the creation of theInducedIdleEventNodeas created bySystem.currentTimeMillis().- Returns:
- the timestamp in milliseconds
-
hasRouteDependentVisitDuration
public boolean hasRouteDependentVisitDuration()Description copied from interface:INodeChecks for route dependent visit duration.- Specified by:
hasRouteDependentVisitDurationin interfaceINode- Overrides:
hasRouteDependentVisitDurationin classAbstractNode- Returns:
- true, if successful
-