The TransitEdge class implements an edge for the SimpleSampleSearch function.
import java.io.Serializable; import com.asterdata.ncluster.graph.data.Edge; import com.asterdata.ncluster.graph.data.VertexKey; /** * Implements an edge for the SimpleSampleSearch function. */ public class TransitEdge extends Edge implements Serializable { // Required for serialization. private static final long serialVersionUID = 1L; // This is the "length" (in kilometers) of the edge. E.g. if SFO and // SJC airports are 100 km apart, then this will be 100. private double distance = 0; // This is the "weight" (influence, capacity, or whatever). This is not the // same as the "sampling weight". private double weight = 0.0; /** * Constructor * * @param targetVertexKey is the vertex key of the target vertex */ TransitEdge(VertexKey targetVertexKey) { super(targetVertexKey); } /** * Constructor * * @param targetVertexKey is the vertex key of the target vertex. * @param samplingWeight is the "sampling weight" of the edge. * @param distance is the length of the edge (in kilometers). */ TransitEdge(VertexKey targetVertexKey, double samplingWeight, double dist) { super(targetVertexKey, samplingWeight); distance = dist; } // Returns the length/distance of this edge (in kilometers). public double getDistance() { return distance; } // Returns the "weight" of this edge. public double getWeight() { return weight; } // Sets the "weight" of this edge. public void setWeight(double w) { weight = w; } } // Class TransitEdge