Package com.amalgamasimulation.graph
Interface Algorithm.GraphTraversalContextCalculator<A,B,C>
- Enclosing interface:
Algorithm
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Functional interface for a function answering the question "What must be the
context of the node being added considering we know the added arc, the added
node itself, and the context of the already traversed node adjacent to this
arc?"
Example of implementation for context of type Double:
(addedArc, addedNode, addedArcDirection, prevNodeContext) -> prevNodeContext + addedArc.getValue().getLength()
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptioncalculateNextNodeContext(Graph<A, B>.Arc addedArc, Graph<A, B>.Node addedNode, Algorithm.ArcRelativeDirection addedArcDirection, C prevNodeContext) Function answering the question "What must be the context of the node being added considering we know the added arc, the added node itself, and the context of the already traversed node adjacent to this arc?"
-
Method Details
-
calculateNextNodeContext
C calculateNextNodeContext(Graph<A, B>.Arc addedArc, Graph<A, B>.Node addedNode, Algorithm.ArcRelativeDirection addedArcDirection, C prevNodeContext) Function answering the question "What must be the context of the node being added considering we know the added arc, the added node itself, and the context of the already traversed node adjacent to this arc?"- Parameters:
addedArc- added arcaddedNode- added nodeaddedArcDirection- direction of the added arc,Algorithm.ArcRelativeDirection.OUTGOINGorAlgorithm.ArcRelativeDirection.INCOMINGprevNodeContext- context of the previous node- Returns:
- context of the added node
- See Also:
-