Skip to main content

@PHXClassDecorator(PHXTException_Decorator)

class PHXDouble(PHXSimpleType)

The ModelCenter type for doubles. This class adds the following features to the PHXSimpleType:
  • value: double
  • valueStr: the source string for the value, useful for error checking when the value is NaN
  • hasUpperValue: boolean
  • upperValue: double
  • hasLowerValue: boolean
  • lowerValue: double
  • enumValues: double[]
  • enumValues: string[]
If the variable has an upper or lower bound and an attempt is made to store an invalid value, then an exception will be thrown.

def __init__(self, varName)

initializes value to zero without upper or lower bounds
  • @param varName: the name of the variable already declared in the wrapper to reference
  • @type varName: string
  • @rtype: void

def getValue(self)

retrieves the current value of the variable
  • @rtype: double

def setValue(self, val)

sets the value for the variable
  • @param val: the value
  • @type val: double
  • @rtype: void

def toString(self)

converts the variable to a string
  • @rtype: string

def fromString(self, val)

converts a String representation to the internal value
  • @param val: the value to convert
  • @type val: string
  • @rtype: void

def getEnumAliases(self)

Gets the enumeration aliases list
  • @rtype: string[]

def setEnumAliases(self, aliases)

Sets the enumeration aliases list
  • @param aliases: An array of strings
  • @type aliases: string (as a comma-separated list) or string[]
  • @rtype: void

def getEnumValues(self)

Gets the enumeration values list
  • @rtype: double[]

def setEnumValues(self, values)

Sets the enumeration values list
  • @param values: Either a comma-separated list of values or an array of values
  • @type values: string (as a comma-separated list) or double[]
  • @rtype: void

def getFormat(self)

retrieves the format of the variable
  • @rtype: string

def setFormat(self, format)

sets the format options
  • @param format: the new format
  • @type format: string
  • @rtype: void

def getHasLowerBound(self)

retrieves the hasLowerBound flag
  • @rtype: boolean

def setHasLowerBound(self, value)

sets the lower bound. The hasLowerBound value is set to true
  • @type value: boolean
  • @rtype: void

def getHasUpperBound(self)

retrieves the hasUpperBound flag
  • @rtype: boolean

def setHasUpperBound(self, value)

sets the hasUpperBound flag
  • @type value: boolean
  • @rtype: void

def getLowerBound(self)

retrieves the current lower bound value
  • @rtype: double

def setLowerBound(self, value)

sets the lower bound. The hasLowerBound value is set to true
  • @param value: the lower bound
  • @type value: double
  • @rtype: void

def getUpperBound(self)

retrieves the current upper bound value
  • @rtype: double

def setUpperBound(self, value)

sets the upper bound. The hasUpperBound value is set to true
  • @param value: the upper bound
  • @type value: double
  • @rtype: void

def getValueStr(self)

retrieves the current value of the variable (in string form)
  • @rtype: string