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
ConstructorDescriptionThe constructor for arelation
between twoNodes
that must be visited by the same or differentResource
. -
Method Summary
Modifier and TypeMethodDescriptioncom.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) boolean
boolean
Checks if a differentResource
has to visit the twoNodes
.boolean
boolean
Checks whether the sameResource
is forced to visit bothNodes
boolean
Needs full job level evaluation.void
setIsForcedDifferentRoute
(boolean isForcedDifferentVisitor) Sets the checks if is forced different route.void
Enforces a differentResource
to visit the twoNodes
.void
Sets the is forced same route.void
Enforces that the sameResource
visits the twoNodes
.void
Sets 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, setRelationMode
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.dna.jopt.member.unit.relation.node2node.INode2NodeRelation
getRelatedNode, getRelatedNodes, hasValidRelatedItem, setRelatedNode, setRelatedNodes
Methods 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 arelation
between twoNodes
that must be visited by the same or differentResource
.
-
-
Method Details
-
setIsForcedDifferentVisitor
public void setIsForcedDifferentVisitor()Enforces a differentResource
to visit the twoNodes
.- Specified by:
setIsForcedDifferentVisitor
in interfaceINode2NodeVisitorRelation
-
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 interfaceINode2NodeVisitorRelation
-
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 interfaceINode2NodeVisitorRelation
- Parameters:
isForcedDifferentVisitor
- if true, a different visitor is also required.
-
setIsForcedSameVisitor
public void setIsForcedSameVisitor()Enforces that the sameResource
visits the twoNodes
.- Specified by:
setIsForcedSameVisitor
in interfaceINode2NodeVisitorRelation
-
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 interfaceINode2NodeVisitorRelation
-
isForcedSameVisitor
public boolean isForcedSameVisitor()Checks whether the sameResource
is forced to visit bothNodes
- Returns:
- true if same Resource
-
isForcedDifferentVisitor
public boolean isForcedDifferentVisitor()Checks if a differentResource
has 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:
checkRelation
in interfaceINode2NodeRelation
-
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 interfaceINodeRelation
- Returns:
- boolean true if successful
-