Class RingTopology

java.lang.Object
org.moeaframework.parallel.island.topology.RingTopology
All Implemented Interfaces:
Topology

public class RingTopology extends Object implements Topology
A ring topology where each island is only connected to one (unidirectional) or two adjacent islands (bidirectional), thus forming the shape of a ring.
  • Constructor Details

    • RingTopology

      public RingTopology()
      Constructs a bidirectional ring topology instance.
    • RingTopology

      public RingTopology(boolean bidirectional)
      Constructs a ring topology instance.
      Parameters:
      bidirectional - true if the ring connects to both neighbors; false if only one
  • Method Details

    • getNeighbors

      public List<Island> getNeighbors(Island current, List<Island> allIslands)
      Description copied from interface: Topology
      Returns the neighboring islands for the current island.
      Specified by:
      getNeighbors in interface Topology
      Parameters:
      current - the current island
      allIslands - the list of all islands
      Returns:
      the neighboring islands