Class LinLog

All Implemented Interfaces:
AttributeSink, ElementSink, Pipe, Sink, Source, Layout, org.miv.pherd.ParticleBoxListener

public class LinLog
extends BarnesHutLayout
  • Constructor Details

    • LinLog

      public LinLog()
      New "LinLog" 2D Barnes-Hut simulation.
    • LinLog

      public LinLog​(boolean is3D)
      New "LinLog" Barnes-Hut simulation.
      Parameters:
      is3D - If true the simulation dimensions count is 3 else 2.
    • LinLog

      public LinLog​(boolean is3D, Random randomNumberGenerator)
      New "LinLog" Barnes-Hut simulation.
      Parameters:
      is3D - If true the simulation dimensions count is 3 else 2.
      randomNumberGenerator - The random number generator to use.
  • Method Details

    • configure

      public void configure​(double a, double r, boolean edgeBased, double force)
    • getLayoutAlgorithmName

      public String getLayoutAlgorithmName()
      Description copied from interface: Layout
      Name of the layout algorithm.
      Specified by:
      getLayoutAlgorithmName in interface Layout
      Specified by:
      getLayoutAlgorithmName in class BarnesHutLayout
    • setQuality

      public void setQuality​(double qualityLevel)
      Description copied from interface: Layout
      Set the overall quality level, a number between 0 and 1 with 1 the highest quality available, but often with a slower computation.
      Specified by:
      setQuality in interface Layout
      Overrides:
      setQuality in class BarnesHutLayout
      Parameters:
      qualityLevel - The quality level, a number between 0 and 1.
    • compute

      public void compute()
      Description copied from interface: Layout
      Method to call repeatedly to compute the layout.

      This method implements the layout algorithm proper. It must be called in a loop, until the layout stabilizes. You can know if the layout is stable by using the Layout.getNodeMovedCount() method that returns the number of node that have moved during the last call to step().

      The listener is called by this method, therefore each call to step() will also trigger layout events, allowing to reproduce the layout process graphically for example. You can insert the listener only when the layout stabilized, and then call step() anew if you do not want to observe the layout process.

      Specified by:
      compute in interface Layout
      Overrides:
      compute in class BarnesHutLayout
    • newNodeParticle

      public NodeParticle newNodeParticle​(String id)
      Description copied from class: BarnesHutLayout
      Factory method to create node particles.
      Specified by:
      newNodeParticle in class BarnesHutLayout
      Parameters:
      id - The identifier of the new node/particle.
      Returns:
      The new node/particle.