Class SpiNNakerTriadGeometry
java.lang.Object
uk.ac.manchester.spinnaker.machine.SpiNNakerTriadGeometry
public final class SpiNNakerTriadGeometry extends Object
Geometry of a "triad" of SpiNNaker boards.
The geometry is defined by the arguments to the constructor; the standard arrangement can be obtained from get_spinn5_geometry.
Note that the geometry defines what a Triad is in terms of the dimensions of a triad and where the root chips occur in the triad.
- Author:
- Christian-B
- See Also:
- Python Version
-
Field Summary
Fields Modifier and Type Field Description int
triadHeight
Height of a triad in chips.int
triadWidth
Width of a triad in chips. -
Method Summary
Modifier and Type Method Description ChipLocation
getLocalChipCoordinate(HasChipLocation chip)
Converts whole machine coordinates into local ones.Set<ChipLocation>
getPotentialRootChips(MachineDimensions dimensions)
Get the coordinates of bottom left chip on each board.ChipLocation
getRootChip(HasChipLocation chip, int width, int height)
Finds the root Chip for the board this Chip is on.static SpiNNakerTriadGeometry
getSpinn5Geometry()
Get the geometry object for a SpiNN-5 arrangement of boards.Collection<ChipLocation>
singleBoard()
An Collection all the chips on a Single board with a root of 0, 0.void
singleBoardForEach(Consumer<ChipLocation> action)
Allows forEach to be called on all ChipLocations in SingleBoardCoordinates.Iterator<ChipLocation>
singleBoardIterator()
An Iterator all the chips on a Single board with a root of 0, 0.
-
Field Details
-
triadHeight
public final int triadHeightHeight of a triad in chips. -
triadWidth
public final int triadWidthWidth of a triad in chips.
-
-
Method Details
-
getRootChip
Finds the root Chip for the board this Chip is on.Warning: parameter order is width, height to match python.
- Parameters:
chip
- Location of Chip with X and Y expresses as whole machine coordinates.width
- The width of the machine to find the chips in.height
- The height of the machine to find the chips in.- Returns:
- The whole machine location of the Bottom Left Chip expressed as whole machine coordinates.
-
getLocalChipCoordinate
Converts whole machine coordinates into local ones.- Parameters:
chip
- Location of Chip with X and Y expresses as whole machine coordinates.- Returns:
- The local coordinates of the Chip on board.
-
getPotentialRootChips
Get the coordinates of bottom left chip on each board.The bottom left Chip(s) are the ones with the local coordinates 0, 0. This is also typically the ethernet one.
No check is done to see if all the boards are present, nor if the root chip is present and active.
- Parameters:
dimensions
- Size of the machine along the x and y axes in Chips.- Returns:
- List of the root ChipLocation that would be there is all possible boards in the width and height are present.
-
singleBoard
An Collection all the chips on a Single board with a root of 0, 0.- Returns:
- An unmodifiable Collection of the Locations on one board.
-
singleBoardIterator
An Iterator all the chips on a Single board with a root of 0, 0.- Returns:
- All the Locations on one board.
-
singleBoardForEach
Allows forEach to be called on all ChipLocations in SingleBoardCoordinates.- Parameters:
action
- The action to be performed for each element
-
getSpinn5Geometry
Get the geometry object for a SpiNN-5 arrangement of boards.Note the centres are slightly offset so as to force which edges are included where
- Returns:
- SpiNN5 geometry
-