UnitConverter

class UnitConverter(targetTimeUnit: MeasurementUnit, targetInformationUnit: MeasurementUnit, dynamicRange: DynamicRange)

Utility class that converts values and distributions to a desired unit. This class provides a convenient way to keep fixed preferences regarding what time and information units to expect on the output and apply those conversion when possible.

class Object
trait Matchable
class Any

Value members

Concrete methods

Tries to convert a Distribution from its unit and dynamic range to the appropriate time/information unit set when creating this UnitConverter. If the Distribution unit's dimension is not time or information then values will only be converted to a different dynamic range, if necessary.

Tries to convert a Distribution from its unit and dynamic range to the appropriate time/information unit set when creating this UnitConverter. If the Distribution unit's dimension is not time or information then values will only be converted to a different dynamic range, if necessary.

def convertValue(value: Double, unit: MeasurementUnit): Double

Tries to convert a value from its unit to the appropriate time/information unit set when creating this UnitConverter. If the value unit's dimension is not time or information then values will be returned unchanged.

Tries to convert a value from its unit to the appropriate time/information unit set when creating this UnitConverter. If the value unit's dimension is not time or information then values will be returned unchanged.