Class ChipLocation
java.lang.Object
uk.ac.manchester.spinnaker.machine.ChipLocation
- All Implemented Interfaces:
Serializable
,Comparable<ChipLocation>
,HasChipLocation
@Immutable
public final class ChipLocation
extends Object
implements HasChipLocation, Comparable<ChipLocation>, Serializable
The location of a
Chip
as an X and Y tuple.
This class is final as it is used a key in maps.
- Author:
- Alan Stokes, Donal Fellows
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ChipLocation
The location (1,0), which is the one to the east/right of the bottom/left corner.static final ChipLocation
The location (0,0), which is in the bottom/left corner and typically the Ethernet-enabled chip for the lead board of an allocation. -
Constructor Summary
ConstructorsConstructorDescriptionChipLocation
(int x, int y) Create the location of a chip on a SpiNNaker machine. -
Method Summary
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface uk.ac.manchester.spinnaker.machine.HasChipLocation
getScampCore, onSameChipAs
-
Field Details
-
ZERO_ZERO
The location (0,0), which is in the bottom/left corner and typically the Ethernet-enabled chip for the lead board of an allocation. It is also typically the boot board of an allocation. -
ONE_ZERO
The location (1,0), which is the one to the east/right of the bottom/left corner.This location has special meaning on a 4 chip board.
-
-
Constructor Details
-
ChipLocation
public ChipLocation(int x, int y) Create the location of a chip on a SpiNNaker machine.- Parameters:
x
- The X coordinatey
- The Y coordinate- Throws:
IllegalArgumentException
- Thrown is either x or y is negative or too big.
-
-
Method Details
-
equals
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareTo
in interfaceComparable<ChipLocation>
-
getX
public int getX()- Specified by:
getX
in interfaceHasChipLocation
- Returns:
- The X coordinate of the chip.
-
getY
public int getY()- Specified by:
getY
in interfaceHasChipLocation
- Returns:
- The Y coordinate of the chip.
-
toString
-
asChipLocation
Description copied from interface:HasChipLocation
Converts (if required) this to a simple X, Y tuple.- Specified by:
asChipLocation
in interfaceHasChipLocation
- Returns:
- A ChipLocation representation of the X and Y tuple
-