Package edu.claflin.finder.algo.clustering.struct.infomap_struct

# Class AvgBitLength

java.lang.Object
edu.claflin.finder.algo.clustering.struct.infomap_struct.AvgBitLength

public class AvgBitLength extends Object

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `private Graph`
  `graph`
  `private Map<Integer,List<Node>>`
  `modules`
  `private static final int`
  `MULTIPLIER`
  `private Map<Node,Integer>`
  `nodeToModule`
  `private ArrayList<Node>`
  `randomPath`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AvgBitLength(Graph graph, Map<Integer,List<Node>> modules)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `double`
  `avgBitLength()`
  Calculates average bit length for random path of this graph
  `private static ArrayList<Node>`
  `randomWalker(Graph g)`
  Generates a path taken by random walker.
  `void`
  `setGraph(Graph graph)`
  `void`
  `setModules(Map<Integer,List<Node>> modules)`
  `private static ArrayList<Node>`
  `testRandomWalker(Graph g)`
  `private double`
  `totalExitCodes(Map<Integer,Integer> moduleFrequency)`
  `private double`
  `totalModuleCode(Map<Integer,List<Node>> modules, Map<Integer,Integer> moduleFrequency)`
  `private double`
  `totalModuleFreq(Map<Integer,Integer> moduleFrequency)`
  `private double`
  `totalModuleNodeFreq(List<Node> moduleNodes)`
  `private double`
  `totalNodeFreq(List<Node> nodes)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### MULTIPLIER

    private static final int MULTIPLIER
    See Also:
      - Constant Field Values

  - ### graph

    private Graph graph

  - ### randomPath

    private ArrayList<Node> randomPath

  - ### modules

    private Map<Integer,List<Node>> modules

  - ### nodeToModule

    private Map<Node,Integer> nodeToModule

- ## Constructor Details

  - ### AvgBitLength

    public AvgBitLength(Graph graph, Map<Integer,List<Node>> modules)

- ## Method Details

  - ### setGraph

    public void setGraph(Graph graph)

  - ### setModules

    public void setModules(Map<Integer,List<Node>> modules)

  - ### randomWalker

    private static ArrayList<Node> randomWalker(Graph g)
    Generates a path taken by random walker. Will be used to calculate average bit length

  - ### testRandomWalker

    private static ArrayList<Node> testRandomWalker(Graph g)

  - ### avgBitLength

    public double avgBitLength()
    Calculates average bit length for random path of this graph
    Returns:

  - ### totalModuleCode

    private double totalModuleCode(Map<Integer,List<Node>> modules, Map<Integer,Integer> moduleFrequency)

  - ### totalModuleFreq

    private double totalModuleFreq(Map<Integer,Integer> moduleFrequency)

  - ### totalExitCodes

    private double totalExitCodes(Map<Integer,Integer> moduleFrequency)

  - ### totalNodeFreq

    private double totalNodeFreq(List<Node> nodes)

  - ### totalModuleNodeFreq

    private double totalModuleNodeFreq(List<Node> moduleNodes)