Class PhysicalCoords

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

@Immutable public final class PhysicalCoords extends Object implements Comparable<PhysicalCoords>
Physical board coordinates. The cabinet and frame (with multiple frames per cabinet) describe where a board is located within the physical layout of the machine (and also which BMP is managing it, as there is one managing BMP per frame). The board number says which board within the frame is being referred to.

Serialisation Formats

Defaults to being serialised as a JSON object:
{"cabinet": 3, "frame": 2, "board": 1}
and can be deserialized from that, or:
{"c": 3, "f": 2, "b": 1}
It can also accept being deserialised from a JSON array, for a more compact notation:
[3, 2, 1]
Finally, it can also be deserialised from the string form created by the toString() method:
[c:3,f:2,b:1]
Author:
Donal Fellows
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final @uk.ac.manchester.spinnaker.machine.board.ValidBoardNumber int
    Board number.
    final @uk.ac.manchester.spinnaker.machine.board.ValidCabinetNumber int
    Cabinet number.
    final @uk.ac.manchester.spinnaker.machine.board.ValidFrameNumber int
    Frame number.
  • Constructor Summary

    Constructors
    Constructor
    Description
    PhysicalCoords(int c, int f, int b)
    Create an instance.
    PhysicalCoords(String serialForm)
    Create an instance from its serial form.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
     
    boolean
     
     
    int
     
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • c

      @ValidCabinetNumber public final @uk.ac.manchester.spinnaker.machine.board.ValidCabinetNumber int c
      Cabinet number.
    • f

      @ValidFrameNumber public final @uk.ac.manchester.spinnaker.machine.board.ValidFrameNumber int f
      Frame number.
    • b

      @ValidBoardNumber public final @uk.ac.manchester.spinnaker.machine.board.ValidBoardNumber int b
      Board number.
  • Constructor Details

    • PhysicalCoords

      public PhysicalCoords(int c, int f, int b)
      Create an instance.
      Parameters:
      c - Cabinet number.
      f - Frame number.
      b - Board number.
    • PhysicalCoords

      public PhysicalCoords(String serialForm)
      Create an instance from its serial form. The serial form (where the numbers may vary) is:
       [c:34,f:12,b:23]
       
      Parameters:
      serialForm - The form to deserialise.
      Throws:
      IllegalArgumentException - If the string is not in the right form.
  • Method Details