Class ScalefreeGeometry


public class ScalefreeGeometry extends AbstractNetwork
Scale-free network that samples a power-law degree distribution and then constructs a matching undirected graph.
  • Field Details

    • sfExponent

      private double sfExponent
      Power-law exponent used when sampling the degree distribution.
  • Constructor Details

    • ScalefreeGeometry

      public ScalefreeGeometry(EvoLudo engine)
      Create a scale-free geometry tied to the given engine.
      Parameters:
      engine - EvoLudo pacemaker
  • Method Details

    • parse

      public boolean parse(String arg)
      Description copied from class: AbstractGeometry
      Parse geometry-specific CLI options.
      Overrides:
      parse in class AbstractGeometry
      Parameters:
      arg - the argument string without the geometry key
      Returns:
      true if parsing succeeded, false if invalid
    • init

      public void init()
      Generates a connected undirected scale-free network by sampling degrees from a power-law distribution and then constructing a matching graph.
      Specified by:
      init in class AbstractGeometry
    • sampleDegree

      private int sampleDegree(RNGDistribution rng, double[] distr)
      Sample a degree from the given distribution.
      Parameters:
      rng - random number generator
      distr - cumulative distribution of degrees
      Returns:
      the sampled degree
    • swap

      private static void swap(int[] array, int a, int b)
      Swap two entries within an array.
      Parameters:
      array - array whose entries should be swapped
      a - first index
      b - second index
    • checkSettings

      protected boolean checkSettings()
      Description copied from class: AbstractGeometry
      Hook for subclasses to implement geometry specific checks.
      Overrides:
      checkSettings in class AbstractGeometry
      Returns:
      true if adjustments require a reset
    • clone

      public ScalefreeGeometry clone()
      Description copied from class: AbstractGeometry
      Clone geometry.

      Requirements/notes:

      1. Overrides clone() in Object but conflicts with GWT's aversion to clone()ing...
      2. Remove @SuppressWarnings("all") to ensure that no other issues crept in when modifying method.
      Overrides:
      clone in class AbstractGeometry
      Returns:
      clone of geometry
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class AbstractGeometry
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class AbstractGeometry