Class SpinnakerMachine
java.lang.Object
uk.ac.manchester.spinnaker.nmpi.model.machine.SpinnakerMachine
- All Implemented Interfaces:
Serializable
,Comparable<SpinnakerMachine>
public class SpinnakerMachine extends Object implements Serializable, Comparable<SpinnakerMachine>
Represents a SpiNNaker machine on which jobs can be executed.
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description SpinnakerMachine()
Creates an empty machine.SpinnakerMachine(String machineName, String version, int width, int height, int numBoards, String bmpDetails)
Creates a new SpiNNaker Machine description. -
Method Summary
Modifier and Type Method Description int
compareTo(SpinnakerMachine m)
Compare to another machine; order by name then by version.boolean
equals(Object o)
Check for equality with another machine.int
getArea()
String
getBmpDetails()
Gets the BMP details of the machine.int
getHeight()
Gets the height of the machine in chips.String
getMachineName()
Gets the name of the machine.int
getnBoards()
Gets the number of boards in the machine.String
getVersion()
Gets the version of the machine.int
getWidth()
Gets the width of the machine in chips.int
hashCode()
Generate a hash code based on name and version.static SpinnakerMachine
parse(String value)
Creates a new Spinnaker Machine by parsing the name of a machine.void
setBmpDetails(String bmpDetails)
Sets the BMP details of the machine.void
setHeight(int height)
Sets the height of the machine in chips.void
setMachineName(String machineName)
Sets the name of the machine.void
setnBoards(int nBoards)
Sets the number of boards in the machine.void
setVersion(String version)
Sets the version of the machine.void
setWidth(int width)
Sets the width of the machine in chips.String
toString()
Get a string version of the machine.
-
Constructor Details
-
SpinnakerMachine
public SpinnakerMachine()Creates an empty machine. -
SpinnakerMachine
public SpinnakerMachine(String machineName, String version, int width, int height, int numBoards, String bmpDetails)Creates a new SpiNNaker Machine description.- Parameters:
machineName
- The name of the machineversion
- The version of the machinewidth
- The width of the machine, in chipsheight
- The width of the machine, in chipsnumBoards
- The number of boards in the machinebmpDetails
- How to contact the machine's Board Management Processor
-
-
Method Details
-
parse
Creates a new Spinnaker Machine by parsing the name of a machine.- Parameters:
value
- The name of the machine to parse.- Returns:
- The parsed machine descriptor.
- Throws:
IllegalArgumentException
- if the description has the wrong overall formatNumberFormatException
- if one of the parts that should be numeric isn't
-
toString
Get a string version of the machine. -
getMachineName
Gets the name of the machine.- Returns:
- The name of the machine
-
setMachineName
Sets the name of the machine.- Parameters:
machineName
- The name of the machine
-
getVersion
Gets the version of the machine.- Returns:
- The version of the machine
-
setVersion
Sets the version of the machine.- Parameters:
version
- The version of the machine
-
getWidth
public int getWidth()Gets the width of the machine in chips.- Returns:
- The width of the machine
-
setWidth
public void setWidth(int width)Sets the width of the machine in chips.- Parameters:
width
- The width of the machine
-
getHeight
public int getHeight()Gets the height of the machine in chips.- Returns:
- The height of the machine
-
setHeight
public void setHeight(int height)Sets the height of the machine in chips.- Parameters:
height
- The height of the machine
-
getArea
public int getArea()- Returns:
- width × height
-
getnBoards
public int getnBoards()Gets the number of boards in the machine.- Returns:
- The number of boards in the machine
-
setnBoards
public void setnBoards(int nBoards)Sets the number of boards in the machine.- Parameters:
nBoards
- The number of boards in the machine
-
getBmpDetails
Gets the BMP details of the machine.- Returns:
- The BMP details of the machine
-
setBmpDetails
Sets the BMP details of the machine.- Parameters:
bmpDetails
- The BMP details of the machine
-
equals
Check for equality with another machine. -
compareTo
Compare to another machine; order by name then by version.- Specified by:
compareTo
in interfaceComparable<SpinnakerMachine>
-
hashCode
public int hashCode()Generate a hash code based on name and version.
-