Class CalibrationTable
java.lang.Object
org.palladiosimulator.protocom.resourcestrategies.activeresource.CalibrationTable
Class representing the calibration table. Stores a collection of calibration entries.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Default number of tuples <targetTime, parameter> to store in the calibration tableprotected org.palladiosimulator.protocom.resourcestrategies.activeresource.CalibrationEntry[]
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addEntry
(int entryNumber, org.jscience.physics.amount.Amount<javax.measure.quantity.Duration> targetTime, long parameter) Creates a new calibration entry.static CalibrationTable
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.static CalibrationTable
Loads calibration from config filevoid
Saves calibration to config file.int
size()
Returns the size of the calibration table.byte[]
toBinary()
Serializes the calibration table to a byte array.
-
Field Details
-
DEFAULT_CALIBRATION_TABLE_SIZE
public static final int DEFAULT_CALIBRATION_TABLE_SIZEDefault 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
Loads calibration from config file- Returns:
- The loaded calibration file or null if the file could not be loaded
-
save
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
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:
-