Class RoutingEntry

java.lang.Object
uk.ac.manchester.spinnaker.machine.RoutingEntry
Direct Known Subclasses:
MulticastRoutingEntry

@Immutable
public class RoutingEntry
extends Object
A basic SpiNNaker routing entry.
  • Constructor Details

    • RoutingEntry

      public RoutingEntry​(int route)
      Create a routing entry from its encoded form.
      Parameters:
      route - the encoded route
    • RoutingEntry

      public RoutingEntry​(Iterable<Integer> processorIDs, Iterable<Direction> linkIDs)
      Create a routing entry from its expanded description.
      Parameters:
      processorIDs - The IDs of the processors that this entry routes to. The Duplicate IDs are ignored.
      linkIDs - The IDs of the links that this entry routes to. The duplicate IDs are ignored.
      Throws:
      IllegalArgumentException - If a bad processor ID is given (i.e., one that doesn't match SpiNNaker hardware).
  • Method Details

    • encode

      public int encode()
      Gets the entry as a single word.
      Returns:
      The word-encoded form of the routing entry.
    • getLinkIDs

      public Collection<Direction> getLinkIDs()
      The IDs of the processors that this entry routes to.

      If the RoutingEntry was created from its encoded form and unmodified after that, the list is guaranteed to be sorted in natural order and contain no duplicates.

      Returns:
      An unmodifiable collection over the processor IDs.
    • getProcessorIDs

      public Collection<Integer> getProcessorIDs()
      The ID/directions of the links that this entry routes to.

      If the RoutingEntry was created from its encoded form and unmodified after that, the list is guaranteed to be sorted in natural order and contain no duplicates.

      Returns:
      An unmodifiable view over the link IDs in natural order.