Class PillarEventNode

All Implemented Interfaces:
IOptimizationElement, IPillarEventNode, INode, IPillarNode, Serializable
Direct Known Subclasses:
PillarExtenbdableEventNode

public class PillarEventNode extends EventNode implements IPillarEventNode
This class describes an EventNode that is also a Pillar. PillarEventNodes cannot be attended outside of their OpeningHours, they will be unassigned in case they cannot be visited in time.
Since:
01/09/2019
Version:
01/09/2019
Author:
DNA
See Also:
  • Constructor Details

    • PillarEventNode

      @Deprecated public PillarEventNode(String nodeId, IDutyHours openingHour)
      Deprecated constructor
      Parameters:
      nodeId - the string ID of the node
      openingHour - the iDutyhours when the Node can be given service
    • PillarEventNode

      public PillarEventNode(String nodeId, IOpeningHours openingHour)
      A PillarEventNodes does not have a location and cannot be attended outside of their OpeningHours, it will be skipped instead. The total OpeningHours will be the Duration of the Event.

      Implementation example

      
       // Defining OpeningHours
           IOpeningHours telCoTime = new OpeningHours(
                           ZonedDateTime.of(2020, MAY.getValue(), 6, 14, 0, 0, 0, ZoneId.of("Europe/Berlin")),
                           ZonedDateTime.of(2020, MAY.getValue(), 6, 16, 0, 0, 0, ZoneId.of("Europe/Berlin")));
      
       // Defining Node
           PillarEventNode telCoNoLateArrivals =
                   new PillarEventNode("TelCo no late arrivals", telCoTime);
       
      Parameters:
      nodeId - the string ID of the node
      openingHour - the iOpeninghours of the PillarEventNode
    • PillarEventNode

      public PillarEventNode(String nodeId, IOpeningHours openingHour, Duration visitDuration)
      A PillarEventNodes does not have a location and cannot be attended outside of their OpeningHours, it will be skipped instead. In this constructor the Event is placed within the OpeningHours but not for the full Duration.

      Implementation example

      
       // Defining OpeningHours
           IOpeningHours telCoTime = new OpeningHours(
                           ZonedDateTime.of(2020, MAY.getValue(), 6, 13, 0, 0, 0, ZoneId.of("Europe/Berlin")),
                           ZonedDateTime.of(2020, MAY.getValue(), 6, 17, 0, 0, 0, ZoneId.of("Europe/Berlin")));
      
           Duration durationOfTelCo = Duration.ofMinutes(120);
       // Defining Node
           PillarEventNode telCoNoLateArrivals =
                   new PillarEventNode("TelCo no late arrivals", telCoTime, durationOfTelCo);
       
      Parameters:
      nodeId - the string ID of the node
      openingHour - the iOpeninghours of the PillarEventNode
      visitDuration - the duration of the event
    • PillarEventNode

      public PillarEventNode(String nodeId, IOpeningHours openingHour, Duration visitDuration, boolean isDutyHoursIncludeVisitDuration)
      A PillarEventNodes does not have a location and has to be started within the OpeningHours if isDutyHoursIncludeVisitDuration is false. If isDutyHoursIncludeVisitDuration is true the visitDuration has to fit in the OpeningHours, otherwise the PillarEventnode will be skipped.

      Implementation example

      
       // Defining OpeningHours
           IOpeningHours telCoTime = new OpeningHours(
                           ZonedDateTime.of(2020, MAY.getValue(), 6, 13, 0, 0, 0, ZoneId.of("Europe/Berlin")),
                           ZonedDateTime.of(2020, MAY.getValue(), 6, 14, 0, 0, 0, ZoneId.of("Europe/Berlin")));
      
           Duration durationOfTelCo = Duration.ofMinutes(120);
       // Defining Node
           PillarEventNode telCoNoLateArrivals =
                   new PillarEventNode("TelCo no late arrivals", telCoTime, durationOfTelCo, false);
       
      Parameters:
      nodeId - the string ID of the node
      openingHour - the iOpeningHours
      visitDuration - the duration of the event
      isDutyHoursIncludeVisitDuration - the boolean whether the event has to be finished within the OpeningHours or not
  • Method Details

    • setIsOverwritingRouteTermination

      public void setIsOverwritingRouteTermination(boolean isOverwritingRouteTermination, boolean isAdjustable)
      Description copied from interface: IPillarNode
      Sets the Pillar to bean AnchorPillar at which the Route has to start or end. The boolean defines whether the Pillar can still be moved.
      Specified by:
      setIsOverwritingRouteTermination in interface IPillarNode
      Parameters:
      isOverwritingRouteTermination - the boolean whether it is overwriting route termination
      isAdjustable - the boolean whether it is adjustable
    • isTimeAdjustableAnchor

      public boolean isTimeAdjustableAnchor()
      Description copied from interface: IPillarNode
      Checks PillarTimeWindowGeoNode.isTimeAdjustableAnchor. If yes, then the Pillar is allowed to change time a bit if the Route start is moving as well. The default value is false.
      Specified by:
      isTimeAdjustableAnchor in interface IPillarNode
      Returns:
      the state of isTimeAdjustableAnchor
    • isOverwritingRouteTermination

      public boolean isOverwritingRouteTermination()
      Description copied from interface: IPillarNode
      Checks if it is an AnchorPillar at which the Route has to start or end.
      Specified by:
      isOverwritingRouteTermination in interface IPillarNode
      Returns:
      whether it is overwriting route termination
    • attachResource

      public void attachResource(IResource mandatoryVisitor)
      Description copied from interface: IPillarNode
      Attaching the mandatoryVisitor as the visiting resource will be treated as a hard constraint if a mandatoryVisitor was set using this method.

      Throws an IllegalStateException if a mandatoryVisitor has already been attached

      Specified by:
      attachResource in interface IPillarNode
      Parameters:
      mandatoryVisitor - the Resource to attach to the Pillarnode
    • detachResourceConstraints

      public void detachResourceConstraints()
      Description copied from interface: INode
      Removes all IConstraint. This method is used internally.
      Specified by:
      detachResourceConstraints in interface INode
      Overrides:
      detachResourceConstraints in class AbstractNode
    • detachResourceConstraints

      public void detachResourceConstraints(String resId)
      Description copied from interface: INode
      Removes the IResource with the given resId from the IConstraint that are IConstraintResource. This method is used internally.
      Specified by:
      detachResourceConstraints in interface INode
      Overrides:
      detachResourceConstraints in class AbstractNode
      Parameters:
      resId - the string Resource /D
    • getLastKnownAsRouteTermination

      public boolean getLastKnownAsRouteTermination()
      Specified by:
      getLastKnownAsRouteTermination in interface IPillarNode
    • isAutoFilterProtected

      public boolean isAutoFilterProtected()
      Description copied from interface: INode
      Checks if the Node is protected from being filtered.
      Specified by:
      isAutoFilterProtected in interface INode
      Overrides:
      isAutoFilterProtected in class AbstractNode
      Returns:
      true if the condition allows
    • addConstraint

      public void addConstraint(IConstraint constraint)
      Description copied from interface: INode
      Adds a constraint which limits the Resources that can serve this Node to those that have the specific Qualification to do so.

      For further explanations and implementation examples please see TypeConstraint and TypeQualification.

      Specified by:
      addConstraint in interface INode
      Overrides:
      addConstraint in class AbstractNode
      Parameters:
      constraint - the Iconstraint to be added
    • getAttachedResourceId

      public String getAttachedResourceId()
      Description copied from interface: IPillarNode
      Gets the id of the attachedres, returns null if no resource has been attached.
      Specified by:
      getAttachedResourceId in interface IPillarNode
      Returns:
      the id of the attached resource
    • isOnlyScheduledInCompany

      public boolean isOnlyScheduledInCompany()
      Description copied from interface: IPillarNode
      Some Pillars that are scheduled are not actually jobs. Setting this to true these Pillars only need to be visited if they occur on a day that work Nodes are scheduled. The default value is false.
      Specified by:
      isOnlyScheduledInCompany in interface IPillarNode
      Returns:
      whether the Node is only scheduled in company
    • setIsOnlyScheduledInCompany

      public void setIsOnlyScheduledInCompany(boolean isOnlyScheduledInCompany)
      Description copied from interface: IPillarNode
      Sets the Pillar only to be visited of other work Nodes are scheduled that day. The default value is false.
      Specified by:
      setIsOnlyScheduledInCompany in interface IPillarNode
      Parameters:
      isOnlyScheduledInCompany - the boolean whether the Node is only scheduled in company
    • getFlavour

      Description copied from interface: IOptimizationElement
      Gets the flavour which spells out the kind of Node of the element.
      Specified by:
      getFlavour in interface IOptimizationElement
      Overrides:
      getFlavour in class EventNode
      Returns:
      the flavour
    • isPillarNode

      public boolean isPillarNode()
      Description copied from class: EventNode
      Checks, whether this Node is a PillarNode. Since this is an EventNode the response always is false.
      Specified by:
      isPillarNode in interface INode
      Overrides:
      isPillarNode in class EventNode
      Returns:
      false, since EventNode
      See Also:
    • isResourceAttached

      public boolean isResourceAttached()
      Description copied from interface: IPillarNode
      Checks the state of PillarTimeWindowGeoNode.attachedres.
      Specified by:
      isResourceAttached in interface IPillarNode
      Returns:
      true if an attachedResource has already ben set
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class AbstractNode
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class AbstractNode
    • setIsSchedulableOutsideWorkingHours

      public void setIsSchedulableOutsideWorkingHours(boolean isSchedulableOutsideWorkingsHoursStart, boolean isSchedulableOutsideWorkingsHoursEnd)
      Description copied from interface: IPillarNode
      Sets the Pillar that it has to be visited by a Resource outside of her WorkingHours if IResource.setMaxPillarAfterHoursTime(Duration) is also set to true.
      Specified by:
      setIsSchedulableOutsideWorkingHours in interface IPillarNode
      Parameters:
      isSchedulableOutsideWorkingsHoursStart - the boolean if working is possible before workingHours
      isSchedulableOutsideWorkingsHoursEnd - the boolean if working is possible after workingHours
    • isSchedulableBeforeWorkingHours

      public boolean isSchedulableBeforeWorkingHours()
      Description copied from interface: IPillarNode
      Checks PillarTimeWindowGeoNode.isSchedulableOutsideWorkingsHoursStart. The default value is false.
      Specified by:
      isSchedulableBeforeWorkingHours in interface IPillarNode
      Returns:
      whether working is possible before workingHours
    • isSchedulableAfterWorkingHours

      public boolean isSchedulableAfterWorkingHours()
      Description copied from interface: IPillarNode
      Checks PillarTimeWindowGeoNode.isSchedulableOutsideWorkingsHoursEnd. The default value is false.
      Specified by:
      isSchedulableAfterWorkingHours in interface IPillarNode
      Returns:
      whether working is possible after workingHours
    • isOverwritingRouteStartOrTermination

      public boolean isOverwritingRouteStartOrTermination()
      Description copied from interface: IPillarNode
      Checks if the Pillar is an AnchorPillar in which case the Route has to start or and at said AnchorPillar. The default values are false
      Specified by:
      isOverwritingRouteStartOrTermination in interface IPillarNode
      Returns:
      the states if either the route start or the route termination is overwritten
    • hasRealGeoLocation

      public boolean hasRealGeoLocation()
      Description copied from class: EventNode
      Gets whether this Node has a location. Since this is an Eventnode the response always is false.
      Specified by:
      hasRealGeoLocation in interface IOptimizationElement
      Overrides:
      hasRealGeoLocation in class EventNode
      Returns:
      false, since EventNode