java.lang.Object
org.palladiosimulator.protocom.resourcestrategies.activeresource.CalibrationTable

public class CalibrationTable extends Object
Class representing the calibration table. Stores a collection of calibration entries.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Default number of tuples <targetTime, parameter> to store in the calibration table
    protected org.palladiosimulator.protocom.resourcestrategies.activeresource.CalibrationEntry[]
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Private constructor.
    CalibrationTable(int tableSize)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addEntry(int entryNumber, org.jscience.physics.amount.Amount<javax.measure.quantity.Duration> targetTime, long parameter)
    Creates a new calibration entry.
    fromBinary(byte[] binary)
    Creates a calibration table from a byte array.
    org.palladiosimulator.protocom.resourcestrategies.activeresource.CalibrationEntry
    getEntry(int entryNumber)
    Returns the calibration entry for given number.
    load(File configFile)
    Loads calibration from config file
    void
    save(File configFile)
    Saves calibration to config file.
    int
    Returns the size of the calibration table.
    byte[]
    Serializes the calibration table to a byte array.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • DEFAULT_CALIBRATION_TABLE_SIZE

      public static final int DEFAULT_CALIBRATION_TABLE_SIZE
      Default number of tuples <targetTime, parameter> to store in the calibration table
      See Also:
    • table

      protected org.palladiosimulator.protocom.resourcestrategies.activeresource.CalibrationEntry[] table
  • Constructor Details

    • CalibrationTable

      public CalibrationTable()
      Private constructor. Used when created by loading an existing calibration table.
    • CalibrationTable

      public CalibrationTable(int tableSize)
      Constructor. New calibration table with given size.
      Parameters:
      tableSize - size of the calibration table
  • Method Details

    • load

      public static CalibrationTable load(File configFile)
      Loads calibration from config file
      Returns:
      The loaded calibration file or null if the file could not be loaded
    • save

      public void save(File configFile)
      Saves calibration to config file. Config file uses a Java object stream to serialise the calibration table.
    • toBinary

      public byte[] toBinary()
      Serializes the calibration table to a byte array.
      Returns:
      a byte array containing the serialized calibration table
    • fromBinary

      public static CalibrationTable fromBinary(byte[] binary)
      Creates a calibration table from a byte array.
      Parameters:
      binary - a byte array containing the serialized calibration table
      Returns:
      a new CalibrationTable object
    • getEntry

      public org.palladiosimulator.protocom.resourcestrategies.activeresource.CalibrationEntry getEntry(int entryNumber)
      Returns the calibration entry for given number.
      Parameters:
      entryNumber -
      Returns:
    • addEntry

      public void addEntry(int entryNumber, org.jscience.physics.amount.Amount<javax.measure.quantity.Duration> targetTime, long parameter)
      Creates a new calibration entry.
      Parameters:
      entryNumber - entry number (position in table)
      targetTime -
      parameter -
    • size

      public int size()
      Returns the size of the calibration table.
      Returns: