Class PhysicalCoords
java.lang.Object
uk.ac.manchester.spinnaker.machine.board.PhysicalCoords
- All Implemented Interfaces:
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 -
Constructor Summary
ConstructorsConstructorDescriptionPhysicalCoords
(int c, int f, int b) Create an instance.PhysicalCoords
(String serialForm) Create an instance from its serial form. -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(PhysicalCoords other) boolean
int
hashCode()
toString()
-
Field Details
-
c
Cabinet number. -
f
Frame number. -
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
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
-
equals
-
hashCode
public int hashCode() -
toString
-
getBmpCoords
- Returns:
- The coordinates of the BMP that manages this board.
-
compareTo
- Specified by:
compareTo
in interfaceComparable<PhysicalCoords>
-