Class RelativeTimeWindow2RelatedNodeRelation

All Implemented Interfaces:
INode2NodeRelation, INodeRelation, INode2NodeTempusRelation, Serializable
Direct Known Subclasses:
NegativeRelativeTimeWindow2RelatedNodeRelation

public class RelativeTimeWindow2RelatedNodeRelation extends AbstractNode2NodeTempusRelation
This class allows for Nodes having relative time windows. Two Nodes can be set to have relations in such a manner that the work orders have to be started or fulfilled in a set amount of time or that a specific amount of time has to be between fulfilling work orders.

For information whether the work has to be done within the specified time or the Resource has to have arrived at the RelatedNode within the specified time see INode2NodeTempusRelation.setTimeComparisonJuncture(boolean, boolean).

Since:
03/08/2019
Version:
12/09/2019
Author:
DNA
See Also:
  • Field Details

    • FIXED_PENALTY_MULTIPILCATOR

      protected static final int FIXED_PENALTY_MULTIPILCATOR
      See Also:
  • Constructor Details

    • RelativeTimeWindow2RelatedNodeRelation

      public RelativeTimeWindow2RelatedNodeRelation(long minimalDeviationSeconds, long maximalDeviationSeconds)
      The constructor for setting relative time windows between work orders of specific Nodes.

      Implementation example for the two Nodes "Essen" and Aachen" where the work has to be done within 20 minutes:

      
       INode2NodeTempusRelation relation = new RelativeTimeWindow2RelatedNodeRelation(0, 1200);
        relation.setMasterNode(essen);
        relation.setRelatedNode(aachen);
        relation.setTimeComparisonJuncture(true, true);
        essen.addNode2NodeRelation(relation);
        aachen.addNode2NodeRelation(relation);
       
      For information whether the work has to be done within the specified time or the Resource has to have arrived at the RelatedNode within the specified time see INode2NodeTempusRelation.setTimeComparisonJuncture(boolean, boolean).

      For the constructor using Duration please see RelativeTimeWindow2RelatedNodeRelation(Duration, Duration).

      Parameters:
      minimalDeviationSeconds - the long seconds which have to be between work orders
      maximalDeviationSeconds - the long seconds within which both orders have to be fulfilled
    • RelativeTimeWindow2RelatedNodeRelation

      public RelativeTimeWindow2RelatedNodeRelation(Duration minimalDeviation, Duration maximalDeviation)
      The constructor for setting relative time windows between work orders of specific Nodes.

      Example for the two Nodes "Essen" and Aachen" where a break of 30 minutes has be between the work orders (for example for drying of some material) but everything has to be done within 2 hours.

      Implementation example:

      
       INode2NodeRelation relation =
       new RelativeTimeWindow2RelatedNodeRelation(Duration.ofMinutes(30),Duration.ofHours(2));
      
       relation.setMasterNode(essen);
       relation.setRelatedNode(aachen);
       essen.addNode2NodeRelation(relation);
       aachen.addNode2NodeRelation(relation);
       
      For information whether the work has to be done within the specified time or the Resource has to have arrived at the RelatedNode within the specified time see INode2NodeTempusRelation.setTimeComparisonJuncture(boolean, boolean).
      Parameters:
      minimalDeviation - the duration of the forced break between the two work orders
      maximalDeviation - the duration within the two work orders have to be finished or started
  • Method Details

    • getMinTimeDeviation

      public Duration getMinTimeDeviation()
      Gets the time that has to lay between the two work orders as Duration.
      Returns:
      the minimum seconds between the two nodes
      See Also:
    • getMaxTimeDeviation

      public Duration getMaxTimeDeviation()
      Gets the time within which both nodes have to be visited as a Duration.
      Returns:
      the max seconds between the two Nodes
      See Also:
    • getMinTimeDeviationSeconds

      public long getMinTimeDeviationSeconds()
      Gets the forced break between Nodes as a long seconds.
      Returns:
      the seconds between Nodes
      See Also:
    • getMaxTimeDeviationSeconds

      public long getMaxTimeDeviationSeconds()
      Gets the time within which two Nodes have to be visited as a long.
      Returns:
      the timewindow between two Nodes
      See Also:
    • checkRelation

      public com.dna.jopt.assessment.costassessorrestriction.restrictionresult.IEntityRestrictionResult checkRelation(IEntity en, com.dna.jopt.framework.inputplausibility.properties.IPropertyProvider propertyProvider, com.dna.jopt.assessment.costadjustment.IEntityCostAdjuster cad, ILogicRouteElementDetailItem masterDetails, List<ILogicRouteElementDetailItem> relatedDetailss, boolean resultRequested)
    • needsFullJobLevelEvaluation

      public boolean needsFullJobLevelEvaluation()
      Description copied from interface: INodeRelation
      Needs full job level evaluation.

      In case the relation needs to access for example arrival times etc. of all related nodes e have to save this data for the relation. The cost assessor will ask if the relation requires this and will save the data for the nodes carrying this relation. It is important that every node that is part of a relation is also carrying the relation as object.

      Returns:
      boolean true if successful
    • toString

      public String toString()
      Overrides:
      toString in class Object