Class CoreLocation
java.lang.Object
uk.ac.manchester.spinnaker.machine.CoreLocation
- All Implemented Interfaces:
Serializable
,Comparable<CoreLocation>
,HasChipLocation
,HasCoreLocation
@Immutable
public final class CoreLocation
extends Object
implements HasCoreLocation, Comparable<CoreLocation>, Serializable
The location of a
Processor
on a Chip
as an X, Y, P tuple.
This class is final as it is used a key in maps.
- Author:
- Alan Stokes, Donal Fellows
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCoreLocation
(int x, int y, int p) Create the location of a core on a SpiNNaker machine.CoreLocation
(HasChipLocation chip, int p) Create the location of a core 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
asChipLocation, getScampCore, onSameChipAs
Methods inherited from interface uk.ac.manchester.spinnaker.machine.HasCoreLocation
onSameCoreAs
-
Constructor Details
-
CoreLocation
public CoreLocation(int x, int y, int p) Create the location of a core on a SpiNNaker machine.- Parameters:
x
- The X coordinate, in range 0..255y
- The Y coordinate, in range 0..255p
- The P coordinate, in range 0..17
-
CoreLocation
Create the location of a core on a SpiNNaker machine.- Parameters:
chip
- The X and Y coordinate, in range 0..255p
- The P coordinate, in range 0..17
-
-
Method Details
-
equals
-
hashCode
public int hashCode() -
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.
-
getP
public int getP()- Specified by:
getP
in interfaceHasCoreLocation
- Returns:
- The processor coordinate of the core on its chip.
-
toString
-
asCoreLocation
Description copied from interface:HasCoreLocation
Converts (if required) this to a simple X, Y, P tuple.- Specified by:
asCoreLocation
in interfaceHasCoreLocation
- Returns:
- A CoreLocation representation of the X, Y, P tuple
-
compareTo
- Specified by:
compareTo
in interfaceComparable<CoreLocation>
-