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 ChipLocationThe location (1,0), which is the one to the east/right of the bottom/left corner.static final ChipLocationThe 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, waitMethods 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:
compareToin interfaceComparable<ChipLocation>
-
getX
public int getX()- Specified by:
getXin interfaceHasChipLocation- Returns:
- The X coordinate of the chip.
-
getY
public int getY()- Specified by:
getYin interfaceHasChipLocation- Returns:
- The Y coordinate of the chip.
-
toString
-
asChipLocation
Description copied from interface:HasChipLocationConverts (if required) this to a simple X, Y tuple.- Specified by:
asChipLocationin interfaceHasChipLocation- Returns:
- A ChipLocation representation of the X and Y tuple
-