Class RelativeVisitor2RelatedNodeRelation

java.lang.Object
com.dna.jopt.member.unit.relation.node2node.AbstracNode2NodeRelation
com.dna.jopt.member.unit.relation.node2node.visitor.RelativeVisitor2RelatedNodeRelation
All Implemented Interfaces:
INode2NodeRelation, INodeRelation, INode2NodeVisitorRelation, Serializable

public class RelativeVisitor2RelatedNodeRelation extends AbstracNode2NodeRelation implements INode2NodeVisitorRelation
This interface provides methods which allow to set relations between INodes concerning the specific IResource visiting them.

Example for setting a different visitor among the Nodes "moers" and "gladbach":


 INode2NodeVisitorRelation rel = new RelativeVisitor2RelatedNodeRelation();
     rel.setIsForcedDifferentVisitor();
     rel.setMasterNode(moers);
     rel.setRelatedNode(gladbach);
     moers.addNode2NodeRelation(rel);
     gladbach.addNode2NodeRelation(rel);
 
Since:
03/08/2019
Version:
13/02/2020
Author:
DNA
See Also:
  • Constructor Details

    • RelativeVisitor2RelatedNodeRelation

      public RelativeVisitor2RelatedNodeRelation()
      The constructor for a relation between two Nodes that must be visited by the same or different Resource.
  • Method Details

    • setIsForcedDifferentVisitor

      public void setIsForcedDifferentVisitor()
      Enforces a different Resource to visit the two Nodes.
      Specified by:
      setIsForcedDifferentVisitor in interface INode2NodeVisitorRelation
    • setIsForcedSameVisitorForcedDifferentRoute

      public void setIsForcedSameVisitorForcedDifferentRoute()
      Description copied from interface: INode2NodeVisitorRelation
      Sets the is forced same visitor forced different route.

      Attached nodes should be visited in a different route by the same visitor.

      Specified by:
      setIsForcedSameVisitorForcedDifferentRoute in interface INode2NodeVisitorRelation
    • setIsForcedDifferentRoute

      public void setIsForcedDifferentRoute(boolean isForcedDifferentVisitor)
      Description copied from interface: INode2NodeVisitorRelation
      Sets the checks if is forced different route.

      Attached nodes should be visited in a different route.

      Specified by:
      setIsForcedDifferentRoute in interface INode2NodeVisitorRelation
      Parameters:
      isForcedDifferentVisitor - if true, a different visitor is also required.
    • setIsForcedSameVisitor

      public void setIsForcedSameVisitor()
      Enforces that the same Resource visits the two Nodes.
      Specified by:
      setIsForcedSameVisitor in interface INode2NodeVisitorRelation
    • setIsForcedSameRoute

      public void setIsForcedSameRoute()
      Description copied from interface: INode2NodeVisitorRelation
      Sets the is forced same route.

      Attached nodes should be visited within the same route.

      Specified by:
      setIsForcedSameRoute in interface INode2NodeVisitorRelation
    • isForcedSameVisitor

      public boolean isForcedSameVisitor()
      Checks whether the same Resource is forced to visit both Nodes
      Returns:
      true if same Resource
    • isForcedDifferentVisitor

      public boolean isForcedDifferentVisitor()
      Checks if a different Resource has to visit the two Nodes.
      Returns:
      true if different Resource
    • isForcedSameRoute

      public boolean isForcedSameRoute()
    • isForcedDifferentRoute

      public boolean isForcedDifferentRoute()
    • 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)
      Specified by:
      checkRelation in interface INode2NodeRelation
    • 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.

      Specified by:
      needsFullJobLevelEvaluation in interface INodeRelation
      Returns:
      boolean true if successful