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:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.dna.jopt.member.unit.relation.node2node.AbstracNode2NodeRelation
AbstracNode2NodeRelation.RelationMode -
Constructor Summary
ConstructorsConstructorDescriptionThe constructor for arelationbetween twoNodesthat must be visited by the same or differentResource. -
Method Summary
Modifier and TypeMethodDescriptioncom.dna.jopt.assessment.costassessorrestriction.restrictionresult.IEntityRestrictionResultcheckRelation(IEntity en, com.dna.jopt.framework.inputplausibility.properties.IPropertyProvider propertyProvider, com.dna.jopt.assessment.costadjustment.IEntityCostAdjuster cad, ILogicRouteElementDetailItem masterDetails, List<ILogicRouteElementDetailItem> relatedDetailss, boolean resultRequested) booleanbooleanChecks if a differentResourcehas to visit the twoNodes.booleanbooleanChecks whether the sameResourceis forced to visit bothNodesbooleanNeeds full job level evaluation.voidsetIsForcedDifferentRoute(boolean isForcedDifferentVisitor) Sets the checks if is forced different route.voidEnforces a differentResourceto visit the twoNodes.voidSets the is forced same route.voidEnforces that the sameResourcevisits the twoNodes.voidSets the is forced same visitor forced different route.Methods inherited from class com.dna.jopt.member.unit.relation.node2node.AbstracNode2NodeRelation
checkRelation, getDetailsOfElement, getMasterNode, getRelatedNode, getRelatedNodes, getRelationMode, getRouteOfElement, hasValidRelatedItem, isFilterRelatedNodes, setMasterNode, setRelatedNode, setRelatedNodes, setRelationModeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.dna.jopt.member.unit.relation.node2node.INode2NodeRelation
getRelatedNode, getRelatedNodes, hasValidRelatedItem, setRelatedNode, setRelatedNodesMethods inherited from interface com.dna.jopt.member.unit.relation.node2node.INodeRelation
checkRelation, getMasterNode, getRelationMode, isFilterRelatedNodes, setMasterNode, setRelationMode
-
Constructor Details
-
RelativeVisitor2RelatedNodeRelation
public RelativeVisitor2RelatedNodeRelation()The constructor for arelationbetween twoNodesthat must be visited by the same or differentResource.
-
-
Method Details
-
setIsForcedDifferentVisitor
public void setIsForcedDifferentVisitor()Enforces a differentResourceto visit the twoNodes.- Specified by:
setIsForcedDifferentVisitorin interfaceINode2NodeVisitorRelation
-
setIsForcedSameVisitorForcedDifferentRoute
public void setIsForcedSameVisitorForcedDifferentRoute()Description copied from interface:INode2NodeVisitorRelationSets the is forced same visitor forced different route.Attached nodes should be visited in a different route by the same visitor.
- Specified by:
setIsForcedSameVisitorForcedDifferentRoutein interfaceINode2NodeVisitorRelation
-
setIsForcedDifferentRoute
public void setIsForcedDifferentRoute(boolean isForcedDifferentVisitor) Description copied from interface:INode2NodeVisitorRelationSets the checks if is forced different route.Attached nodes should be visited in a different route.
- Specified by:
setIsForcedDifferentRoutein interfaceINode2NodeVisitorRelation- Parameters:
isForcedDifferentVisitor- if true, a different visitor is also required.
-
setIsForcedSameVisitor
public void setIsForcedSameVisitor()Enforces that the sameResourcevisits the twoNodes.- Specified by:
setIsForcedSameVisitorin interfaceINode2NodeVisitorRelation
-
setIsForcedSameRoute
public void setIsForcedSameRoute()Description copied from interface:INode2NodeVisitorRelationSets the is forced same route.Attached nodes should be visited within the same route.
- Specified by:
setIsForcedSameRoutein interfaceINode2NodeVisitorRelation
-
isForcedSameVisitor
public boolean isForcedSameVisitor()Checks whether the sameResourceis forced to visit bothNodes- Returns:
- true if same Resource
-
isForcedDifferentVisitor
public boolean isForcedDifferentVisitor()Checks if a differentResourcehas to visit the twoNodes.- 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:
checkRelationin interfaceINode2NodeRelation
-
needsFullJobLevelEvaluation
public boolean needsFullJobLevelEvaluation()Description copied from interface:INodeRelationNeeds 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:
needsFullJobLevelEvaluationin interfaceINodeRelation- Returns:
- boolean true if successful
-