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 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 machine
      version - The version of the machine
      width - The width of the machine, in chips
      height - The width of the machine, in chips
      numBoards - The number of boards in the machine
      bmpDetails - How to contact the machine's Board Management Processor
  • Method Details

    • parse

      public static SpinnakerMachine parse​(String value)
      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 format
      NumberFormatException - if one of the parts that should be numeric isn't
    • toString

      public String toString()
      Get a string version of the machine.
      Overrides:
      toString in class Object
    • getMachineName

      public String getMachineName()
      Gets the name of the machine.
      Returns:
      The name of the machine
    • setMachineName

      public void setMachineName​(String machineName)
      Sets the name of the machine.
      Parameters:
      machineName - The name of the machine
    • getVersion

      public String getVersion()
      Gets the version of the machine.
      Returns:
      The version of the machine
    • setVersion

      public void setVersion​(String version)
      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

      public String getBmpDetails()
      Gets the BMP details of the machine.
      Returns:
      The BMP details of the machine
    • setBmpDetails

      public void setBmpDetails​(String bmpDetails)
      Sets the BMP details of the machine.
      Parameters:
      bmpDetails - The BMP details of the machine
    • equals

      public boolean equals​(Object o)
      Check for equality with another machine.
      Overrides:
      equals in class Object
    • compareTo

      public int compareTo​(SpinnakerMachine m)
      Compare to another machine; order by name then by version.
      Specified by:
      compareTo in interface Comparable<SpinnakerMachine>
    • hashCode

      public int hashCode()
      Generate a hash code based on name and version.
      Overrides:
      hashCode in class Object