public class BaseUnitConcept extends UnitConcept
To convert a temperature measurement value in degrees F to degrees K, apply
the formula:
value in K = (value in F + unitOffset) * unitFactor
Inversely, to convert a measurement from the SI unit (K) to this unit (F),
apply this formula:
value in F = (value in K) / unitFactor - unitOffset
So far temperature is the only dimension that requires an offset. All the other dimensions only require a multiplication factor, so their offset is always zero. For example, To represent the position dimension units in kilometers (km):
The SI unit for position is meters (m) so the kilometers unitFactor is 1000.0 and there is zero offset.
This class is an infinite concept so that an arbitrary number of different unit measurements can be represented for any physical dimension. All that is required is specify the name of units and the multiplication factor and offset needed to convert the unit to the SI unit for that dimension.
BaseDimensionRepresentativeConcept
Red (cshelton) |
Red (cshelton) |
Entity.ContainedObjectsIterator
_unitFactor, _unitOffset
_representative, _tokenValue
isAcceptable
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
Modifier | Constructor and Description |
---|---|
protected |
BaseUnitConcept(Ontology ontology,
BaseDimensionRepresentativeConcept representative,
RecordToken unitInfo)
Create a new BaseUnitConcept, belonging to the given
ontology.
|
Modifier and Type | Method and Description |
---|---|
static BaseUnitConcept |
createBaseUnitConcept(Ontology ontology,
BaseDimensionRepresentativeConcept representative,
RecordToken unitInfo)
Create a new base unit concept, belonging to the given
ontology, with an automatically generated name.
|
canBeConvertedTo, getDimension, getUnitFactor, getUnitName, getUnitOffset, toString
compare, createFlatTokenInfiniteConcept, equals, getColor, getRepresentative, getTokenValue, greatestLowerBound, hashCode, leastUpperBound
getAssociatedObject, getOntology, getValue, getVariables, initialize, isAboveOrEqualTo, isSettable, isValueAcceptable, setValue
_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, clone, getContainer, instantiate, isAtomic, isOpaque, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, newPort, propagateExistence, setContainer, setName
_addPort, _description, _exportMoMLContents, _removePort, _validateSettables, connectedPortList, connectedPorts, connectionsChanged, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName
_setParent, exportMoML, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _executeChangeRequests, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, addHierarchyListener, attributeChanged, attributeDeleted, attributeList, attributeList, attributeTypeChanged, clone, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getFullName, getModelErrorHandler, getName, getName, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, validateSettables, workspace
finalize, getClass, notify, notifyAll, wait, wait, wait
getDerivedLevel, getDerivedList, propagateValue
description, getDisplayName, getFullName, getName, getName
protected BaseUnitConcept(Ontology ontology, BaseDimensionRepresentativeConcept representative, RecordToken unitInfo) throws IllegalActionException, NameDuplicationException
ontology
- The ontology to which this concept belongs.representative
- The finite concept that represents the physical
dimension for the set infinite concepts that represent units for
this dimension in the ontology lattice.unitInfo
- The record token value that has the name and scale
factor information for this unit.NameDuplicationException
- Should never be thrown.IllegalActionException
- If the base class throws it.public static BaseUnitConcept createBaseUnitConcept(Ontology ontology, BaseDimensionRepresentativeConcept representative, RecordToken unitInfo) throws IllegalActionException
ontology
- The ontology to which this concept belongs.representative
- The finite concept that represents where the infinite
token concepts belong in the ontology lattice.unitInfo
- The token value for this BaseUnitConcept.IllegalActionException
- If the base class throws it.