Class TimeWindowGeoNode

All Implemented Interfaces:
IOptimizationElement, INode, Serializable
Direct Known Subclasses:
PillarTimeWindowGeoNode

public class TimeWindowGeoNode extends AbstractNode
The TimeWindowGeoNode is a normal INode. It specifies a name and a place that IResource have to visit, including the IOpeningHours when the work has to be done and the duration of the work and the importance.
Since:
14/08/2019
Version:
13/08/2019
Author:
DNA
See Also:
  • Constructor Details

    • TimeWindowGeoNode

      public TimeWindowGeoNode()
    • TimeWindowGeoNode

      public TimeWindowGeoNode(String nodeId, double latitude, double longitude, List<IOpeningHours> openingHours, Duration visitDuration, int importance)
      This is the constructor for a TimeWindowGeoNode that is a normal INode. It specifies a name and a place that IResource have to visit, including the IOpeningHours when the work has to be done and the duration of the work and the importance.

      Implementation example:

      
       // Define the opening hours
       List<IOpeningHours> weeklyOpeningHours = new ArrayList<IOpeningHours>();
           weeklyOpeningHours.add(
               new OpeningHours(
                   ZonedDateTime.of(2020, MAY.getValue(), 6, 14, 0, 0, 0, ZoneId.of("Europe/Berlin")),
                   ZonedDateTime.of(2020, MAY.getValue(), 6, 21, 0, 0, 0, ZoneId.of("Europe/Berlin"))));
      
           weeklyOpeningHours.add(
               new OpeningHours(
                   ZonedDateTime.of(2020, MAY.getValue(), 7, 14, 0, 0, 0, ZoneId.of("Europe/Berlin")),
                   ZonedDateTime.of(2020, MAY.getValue(), 7, 21, 0, 0, 0, ZoneId.of("Europe/Berlin"))));
      
       // Defining an (optional) constraint
       IConstraint typeConstraint = new TypeConstraint();
       ((TypeConstraint) typeConstraint).addType("plumbing");
       typeConstraint.setIsHard(true);
      
       Duration visitDuration = Duration.ofMinutes(20);
      
       TimeWindowGeoNode aachen =
       new TimeWindowGeoNode("Aachen", 50.775346, 6.083887, weeklyOpeningHours, visitDuration, 1);
       aachen.addConstraint(typeConstraint);
       this.addElement(aachen);
       
      Parameters:
      nodeId - the string name of the node
      latitude - the double latitude of the starting location
      longitude - the double longitude of the starting location
      openingHours - the iOpeninghours when Resources can visit the Node
      visitDuration - the duration length the visit will be
      importance - the int importance to visit this Node
    • TimeWindowGeoNode

      public TimeWindowGeoNode(String nodeId, com.dna.jopt.config.types.Position pos, List<IOpeningHours> openingHours, Duration visitDuration, int importance)
    • TimeWindowGeoNode

      public TimeWindowGeoNode(String nodeId, double latitude, double longitude, IOpeningHours openingHour, Duration visitDuration, int priority)
      The constructor for a TimeWindowGeoNode where the OpeningHours are not added as a List.

      Implementation example:

      
       // Defining opening hours
       OpeningHours openingHours =
                   new OpeningHours(ZonedDateTime.of(2020, MAY.getValue(), 6, 14, 0, 0, 0, ZoneId.of("Europe/Berlin")),
                           ZonedDateTime.of(2020, MAY.getValue(), 6, 21, 0, 0, 0, ZoneId.of("Europe/Berlin")));
      
      
       // Defining an (optional) constraint IConstraint typeConstraint = new TypeConstraint();
       ((TypeConstraint) typeConstraint).addType("plumbing"); typeConstraint.setIsHard(true);
      
       Duration visitDuration = Duration.ofMinutes(20);
      
       TimeWindowGeoNode aachen =
       new TimeWindowGeoNode("Aachen", 50.775346, 6.083887, openingHours, visitDuration, 1);
       aachen.addConstraint(typeConstraint);
       this.addElement(aachen); 
      Parameters:
      nodeId - the string name of the node
      latitude - the double latitude of the starting location
      longitude - the double longitude of the starting location
      openingHour - the iOpeninghours
      visitDuration - the duration length the visit will be
      priority - the int priority to visit this node
    • TimeWindowGeoNode

      public TimeWindowGeoNode(String nodeId, com.dna.jopt.config.types.Position pos, IOpeningHours openingHour, Duration visitDuration, int priority)
  • Method Details

    • getFlavour

      Description copied from interface: IOptimizationElement
      Gets the flavour which spells out the kind of Node of the element.
      Returns:
      the flavour
    • hasRealGeoLocation

      public boolean hasRealGeoLocation()
      Description copied from interface: IOptimizationElement
      Returns true if the item has a real geo location. For example, an EventNode has no real geo location.
      Returns:
      true, if real geo location exists
    • isPillarNode

      public boolean isPillarNode()
      Description copied from interface: INode
      Checks if the node is a isPillarNode. PillarNodes will only be served if the Resource arrives on time. If the Resource is arriving too late the PillarNode will be skipped.
      Returns:
      the boolean isPillarNode