Class InducedIdleEventNode

All Implemented Interfaces:
IOptimizationElement, INode, Serializable

public class InducedIdleEventNode extends EventNode
This class
Since:
31/01/2020
Version:
31/01/2020
Author:
DNA
See Also:
  • Field Details

  • Constructor Details

    • InducedIdleEventNode

      public InducedIdleEventNode(String nodeId, IOpeningHours openingHour, Duration duration)
      The constructor of an InducedIdleEventNode.
      Parameters:
      nodeId - the string ID of the Node
      openingHour - the iOpeningHour
      duration - the duration of the idle time
    • InducedIdleEventNode

      public InducedIdleEventNode(INode2NodeRelation rel, IOpeningHours openingHour, Duration duration)
      The constructor of an InducedIdleEventNode to add to the Node ID the Relations to another Node.
      Parameters:
      rel - the iNode2NodeRelation
      openingHour - the iOpeningHour
      duration - the duration of the idle time
  • Method Details

    • getPartialNodeId

      public static String getPartialNodeId(String masterNodeId, String relatedNodeId)
      Gets the Node ID and adds the masterNodeId and the relatedNodeId.

      Used in InducedIdleEventNode(INode2NodeRelation, IOpeningHours, Duration) to add the IDs of the MasterNode and the RelatedNode to the to the ID of the InducedIdleEventNode

      Parameters:
      masterNodeId - the string ID of the MasterNode
      relatedNodeId - the string ID of the RelatedNode
      Returns:
      the ID in conjunction with the Master- and RelatedNode ID
    • getId

      public String getId()
      Gets the ID and the time it was created.
      Specified by:
      getId in interface IOptimizationElement
      Overrides:
      getId in class AbstractOptimizationElement
      Returns:
      the ID String
    • getShrinkedCopy

      public static InducedIdleEventNode getShrinkedCopy(InducedIdleEventNode baseEvent, long shinkMillis, long safetyAdditionalDuration)
      Gets a copy of the input Node where the input shinkMillis and safetyAdditionalDuration are substracted or added respectively from/to the end of the timeWindow of the OpeningHours in seconds.
      Parameters:
      baseEvent - the node to shrink
      shinkMillis - the long milliseconds to substract from the end of the OpeningHours
      safetyAdditionalDuration - the long milliseconds to add to the end of the OpeningHours
      Returns:
      a copy of the Node with the changed TimeWindow
    • setMasterNodeId

      public void setMasterNodeId(String connectedMasterNodeId)
      Sets the input ID as the MasterNode.

      This method does not actually set up Relations but only sets the input String in the class variable

      Parameters:
      connectedMasterNodeId - the string ID of the MasterNode
    • setRelatedNodeId

      public void setRelatedNodeId(String connectedRelatedNodeId)
      Sets the input ID as the RelatedNode

      This method does not actually set up Relations but only sets the input String in the class variable

      Parameters:
      connectedRelatedNodeId - the string ID of the MasterNode
    • setCreationTimeStamp

      public void setCreationTimeStamp(long creationTimeStamp)
      Sets the input in the form of System.currentTimeMillis() as the TimeStamp when the InducedIdleEventNode was created.
      Parameters:
      creationTimeStamp - the long TimeStamp
    • getMasterNodeId

      public Optional<String> getMasterNodeId()
      Gets the ID of the MasterNode.
      Returns:
      the optional ID
    • getRelatedNodeId

      public Optional<String> getRelatedNodeId()
      Gets the ID of the RelatedNode.
      Returns:
      the optional ID
    • getCreationTimeStamp

      public Optional<Long> getCreationTimeStamp()
      Gets the TimeStamp of the creation of the InducedIdleEventNode as created by System.currentTimeMillis().
      Returns:
      the timestamp in milliseconds
    • hasRouteDependentVisitDuration

      public boolean hasRouteDependentVisitDuration()
      Description copied from interface: INode
      Checks for route dependent visit duration.
      Specified by:
      hasRouteDependentVisitDuration in interface INode
      Overrides:
      hasRouteDependentVisitDuration in class AbstractNode
      Returns:
      true, if successful