java.lang.Object
es.uam.eps.ir.relison.sna.metrics.distance.graph.ASL<U>
Type Parameters:
U - Type of the users.
All Implemented Interfaces:
GraphMetric<U>

public class ASL<U>
extends java.lang.Object
implements GraphMetric<U>
Computes the Average Shortest path Length of graphs.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    private DistanceCalculator<U> dc
    Calculates the distances
    private ASLMode mode
    Calculation mode
  • Constructor Summary

    Constructors 
    Constructor Description
    ASL()
    Default constructor.
    ASL​(DistanceCalculator<U> dc)
    Constructor.
    ASL​(DistanceCalculator<U> dc, ASLMode mode)
    Constructor
    ASL​(ASLMode mode)
    Constructor
  • Method Summary

    Modifier and Type Method Description
    double compute​(Graph<U> graph)
    Computes the value.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • ASL

      public ASL​(DistanceCalculator<U> dc, ASLMode mode)
      Constructor
      Parameters:
      dc - distance calculator.
      mode - the calculation mode.
    • ASL

      public ASL​(DistanceCalculator<U> dc)
      Constructor. Applies the default mode (Averages over all the pairs of distinct nodes without infinite distances
      Parameters:
      dc - distance calculator.
    • ASL

      public ASL​(ASLMode mode)
      Constructor
      Parameters:
      mode - the calculation mode.
    • ASL

      public ASL()
      Default constructor. Applies the default mode (Averages over all the pairs of distinct nodes without infinite distances
  • Method Details

    • compute

      public double compute​(Graph<U> graph)
      Description copied from interface: GraphMetric
      Computes the value.
      Specified by:
      compute in interface GraphMetric<U>
      Parameters:
      graph - graph metric.
      Returns:
      the value of the metric.