Class Network2DGWT

All Implemented Interfaces:
Iterable<Node>, Collection<Node>, Iterator<Node>, List<Node>, SequencedCollection<Node>

public class Network2DGWT extends Network2D
Graphical representation of generic population geometries in 2D. A network corresponds to a (possibly ephemeral) collection and configuration of nodes. This implementation includes optimizations for GWT when scheduling computationally intensive tasks.
Author:
Christoph Hauert
  • Field Details

    • layout

      Duration layout
      Helper variable to keep track of the time spent layouting the network.
    • prevLayout

      int prevLayout
      Time when last layout update was processed.
    • MIN_DELAY_ANIMATE_MSEC

      protected static final int MIN_DELAY_ANIMATE_MSEC
      Minimum delay in milliseconds between subsequent updates of the layout in the GUI. This is used to throttle the animated layout process to a default of at most 20 updates per second.
      See Also:
    • nextLayoutNode

      protected int nextLayoutNode
      Helper variable to store the index of the node that needs to be processed next. This is to prevent the GUI from becoming unresponsive and allow the layouting process to resume after relaxing a fixed number of nodes.
      See Also:
  • Constructor Details

    • Network2DGWT

      public Network2DGWT(EvoLudo engine, Geometry geometry)
      Create a new network in 2D for the given engine and geometry with a layouting process optimzed for GWT.
      Parameters:
      engine - the pacemaker for running the model
      geometry - the structure of the population
  • Method Details

    • reset

      public void reset()
      Description copied from class: Network
      Reset the network (discard any existing layouts).
      Overrides:
      reset in class Network2D
    • doLayout

      public void doLayout(Network.LayoutListener ll)
      Description copied from class: Network
      Start the layouting process. The layout listener (if any) is informed about the progress of the layouting process. Implementations can take advantage of optimizations available for GWT (scheduling) or JRE (multiple threads).
      Specified by:
      doLayout in class Network
      Parameters:
      ll - the layout listener
      See Also:
    • doLayoutStep

      protected boolean doLayoutStep()
      Perform a single step in the layouting process by relaxing nodes sequentially. Returns false once the layouting process has completed, i.e. reached the desired accuracy or the time out.
      Returns:
      true if the layouting process should continue