java.lang.Object
uk.ac.manchester.spinnaker.alloc.db.SQLQueries
uk.ac.manchester.spinnaker.alloc.admin.DirInfo

public final class DirInfo
extends SQLQueries
A mapping that says how to go from one board's coordinates (only the Z coordinate matters for this) to another when you move in a particular direction. Comes from the movement_directions table in the database.

Consider this board layout (a classic 24 board machine, with wrap-arounds not shown):

24-board layout

Bear in mind that 0,1,0 is actually 12 chips vertically and 0 chips horizontally offset from 0,0,0. (Also, the real boards are slightly offset from this layout.)

Author:
Donal Fellows
See Also:
Direction, MachineDefinitionLoader
  • Field Details

    • z

      @ValidTriadZ public final @uk.ac.manchester.spinnaker.machine.board.ValidTriadZ int z
      When your Z coordinate is this.
    • dir

      public final Direction dir
      When you are moving in this direction.
    • dx

      public final int dx
      Change your X coordinate by this.
    • dy

      public final int dy
      Change your Y coordinate by this.
    • dz

      public final int dz
      Change your Z coordinate by this.
  • Method Details

    • get

      public static DirInfo get​(int z, Direction direction)
      Obtain the correct motion information given a starting point and a direction.
      Parameters:
      z - The starting Z coordinate. (Motions are independent of X and Y.) Must be in range 0..2.
      direction - The direction to move in.
      Returns:
      How to move.
    • equals

      public boolean equals​(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object