Class TriadCoords

java.lang.Object
uk.ac.manchester.spinnaker.machine.board.TriadCoords
All Implemented Interfaces:
Comparable<TriadCoords>

public final class TriadCoords extends Object implements Comparable<TriadCoords>
Triad coordinates. Boards are in groups of three (triads) that group together in a rectangular grid. The x and y coordinates say which group of three in the grid, and the z coordinate says which board within the group. The group is not itself rectangular, but tesselates on a rectangular grid.

To understand how the triad coordinate system works, consider this board layout (a classic 24 board machine, with wrap-arounds not shown):

24-board layout

Serialisation Formats

Defaults to being serialised as a JSON object:
{"x": 3, "y": 2, "z": 1}
and can also be deserialized from that, but can also accept being deserialised from a JSON array:
[3, 2, 1]
and can also be deserialized from its string form:
[x:3,y:2,z:1]
Author:
Donal Fellows
  • Field Details

  • Constructor Details

    • TriadCoords

      public TriadCoords(int x, int y, int z)
      Create an instance.
      Parameters:
      x - X coordinate.
      y - Y coordinate.
      z - Z coordinate.
    • TriadCoords

      public TriadCoords(String serialForm)
      Create an instance from its serial form. The serial form (where the numbers may vary) is:
      [x:3,y:5,z:2]
      
      Parameters:
      serialForm - The form to deserialise.
      Throws:
      IllegalArgumentException - If the string is not in the right form.
  • Method Details