Class NetworkTraverser<T>

java.lang.Object
repast.simphony.engine.graph.NetworkTraverser<T>
All Implemented Interfaces:
Traverser<T>

public class NetworkTraverser<T> extends Object implements Traverser<T>
A traverser for Repast Topologies.
Author:
Jerry Vos
  • Constructor Details

    • NetworkTraverser

      public NetworkTraverser(Network<T> topology)
      Constructs this traverser with the specified network topology to retrieve information from.
      Parameters:
      topology - the topology that will be the source of information on passed in nodes
  • Method Details

    • getSuccessors

      public Iterator<T> getSuccessors(T previousNode, T currentNode)
      Retrieves what the current node's nearest neighbors excluding the previous node.
      Specified by:
      getSuccessors in interface Traverser<T>
      Returns:
      the current node's nearest neighbors not including the previous node
      See Also:
    • getDistance

      public double getDistance(T previousNode, T currentNode)
      Retrieves the distance between the nodes according to the topology.
      Specified by:
      getDistance in interface Traverser<T>
      Returns:
      the distance between the nodes