public final class USStandardAtmosphere1976 extends DefinitionalObject
MeanSeaLevel
(get
/ set
) property on EarthCentralBody
before using this model.Modifier and Type | Class and Description |
---|---|
static class |
USStandardAtmosphere1976.Result
The result of the calculation.
|
Constructor and Description |
---|
USStandardAtmosphere1976()
Initializes a new instance.
|
Modifier and Type | Method and Description |
---|---|
USStandardAtmosphere1976.Result |
calculate(double height)
Calculate results from the U.S.
|
protected boolean |
checkForSameDefinition(DefinitionalObject other)
Checks to determine if another instance has the same definition as this instance and
returns
true if it does. |
Object |
clone(CopyContext context)
Clones this object using the specified context.
|
protected int |
computeCurrentDefinitionHashCode()
Computes a hash code based on the current properties of this object.
|
ScalarDependentOnServiceProvider |
getDensity()
Gets a
ScalarDependentOnServiceProvider that calculates atmospheric density
using the U.S. |
ScalarDependentOnServiceProvider |
getDensityRatio()
Gets a
ScalarDependentOnServiceProvider that calculates the ratio
of the local density to the density at sea level
using the U.S. |
double |
getEarthRadius()
Gets the effective radius of the Earth (r0) used by the model, in meters.
|
double |
getEarthSurfaceGravity()
Gets the sea-level value of the acceleration of gravity (g0) used by the model, in m/s^2.
|
Evaluator<USStandardAtmosphere1976.Result> |
getEvaluator(EvaluatorGroup group,
IServiceProvider serviceProvider)
Gets an evaluator that can be used to calculate results from this model for a given location.
|
Evaluator<USStandardAtmosphere1976.Result> |
getEvaluator(IServiceProvider serviceProvider)
Gets an evaluator that can be used to calculate results from this model for a given location.
|
double |
getIdealGasConstant()
Gets the ideal gas constant (R*) used by the model, in J/(kmol*K).
|
double |
getMeanMolecularWeightAtSeaLevel()
Gets the mean molecular weight of the atmosphere at sea level (M0) used by the model, in kg/kmol.
|
ScalarDependentOnServiceProvider |
getPressure()
Gets a
ScalarDependentOnServiceProvider that calculates atmospheric pressure
using the U.S. |
double |
getSpecificHeatRatio()
Gets the ratio of specific heat of air at constant pressure to the specific
heat of air at constant volume used by the model (γ).
|
ScalarDependentOnServiceProvider |
getSpeedOfSound()
Gets a
ScalarDependentOnServiceProvider that calculates the speed of sound
using the U.S. |
ScalarDependentOnServiceProvider |
getTemperature()
Gets a
ScalarDependentOnServiceProvider that calculates temperature
using the U.S. |
void |
setEarthRadius(double value)
Sets the effective radius of the Earth (r0) used by the model, in meters.
|
void |
setEarthSurfaceGravity(double value)
Sets the sea-level value of the acceleration of gravity (g0) used by the model, in m/s^2.
|
void |
setIdealGasConstant(double value)
Sets the ideal gas constant (R*) used by the model, in J/(kmol*K).
|
void |
setMeanMolecularWeightAtSeaLevel(double value)
Sets the mean molecular weight of the atmosphere at sea level (M0) used by the model, in kg/kmol.
|
void |
setSpecificHeatRatio(double value)
Sets the ratio of specific heat of air at constant pressure to the specific
heat of air at constant volume used by the model (γ).
|
areSameDefinition, areSameDefinition, areSameDefinition, areSameDefinition, areSameDefinition, collectionItemsAreSameDefinition, collectionItemsAreSameDefinition, collectionItemsAreSameDefinition, dictionaryItemsAreSameDefinition, enumerateDependencies, freeze, freezeAggregatedObjects, getCollectionHashCode, getCollectionHashCode, getCollectionHashCode, getDefinitionHashCode, getDefinitionHashCode, getDefinitionHashCode, getDefinitionHashCode, getDefinitionHashCode, getDefinitionHashCode, getDictionaryHashCode, getIsFrozen, isSameDefinition, throwIfFrozen
public USStandardAtmosphere1976()
public Object clone(CopyContext context)
This method should be implemented to call a copy constructor on the class of the
object being cloned. The copy constructor should take the CopyContext
as a parameter
in addition to the existing instance to copy. The copy constructor should first call
CopyContext.addObjectMapping(T, T)
to identify the newly constructed instance
as a copy of the existing instance. It should then copy all fields, using
CopyContext.updateReference(T)
to copy any reference fields.
A typical implementation of ICloneWithContext
:
public static class MyClass implements ICloneWithContext {
public MyClass(MyClass existingInstance, CopyContext context) {
context.addObjectMapping(existingInstance, this);
someReference = context.updateReference(existingInstance.someReference);
}
@Override
public final Object clone(CopyContext context) {
return new MyClass(this, context);
}
private Object someReference;
}
In general, all fields that are reference types should be copied with a call to
CopyContext.updateReference(T)
. There are a couple of exceptions:
If one of these exceptions applies, the CopyContext
should be given an opportunity
to update the reference before the reference is copied explicitly. Use
CopyContext.updateReference(T)
to update the reference. If CopyContext.updateReference(T)
returns
the original object, indicating that the context does not have a replacement registered,
then copy the object manually by invoking a Clone method, a copy constructor, or by manually
constructing a new instance and copying the values.
alwaysCopy = context.updateReference(existingInstance.alwaysCopy);
if (existingInstance.alwaysCopy != null && alwaysCopy == existingInstance.alwaysCopy) {
alwaysCopy = (AlwaysCopy) existingInstance.alwaysCopy.clone(context);
}
If you are implementing an evaluator (a class that implements IEvaluator
), the
IEvaluator.updateEvaluatorReferences(agi.foundation.infrastructure.CopyContext)
method shares some responsibilities with the
copy context constructor. Code duplication can be avoided by doing the following:
CopyContext.updateReference(T)
. You should still call CopyContext.updateReference(T)
on any references to
non-evaluators.
IEvaluator.updateEvaluatorReferences(agi.foundation.infrastructure.CopyContext)
as the last line in the constructor and pass it the
same CopyContext
passed to the constructor.
IEvaluator.updateEvaluatorReferences(agi.foundation.infrastructure.CopyContext)
as normal. See the reference documentation for
IEvaluator.updateEvaluatorReferences(agi.foundation.infrastructure.CopyContext)
for more information on implementing that method.
public MyClass(MyClass existingInstance, CopyContext context) {
super(existingInstance, context);
someReference = context.updateReference(existingInstance.someReference);
evaluatorReference = existingInstance.evaluatorReference;
updateEvaluatorReferences(context);
}
@Override
public void updateEvaluatorReferences(CopyContext context) {
evaluatorReference = context.updateReference(evaluatorReference);
}
@Override
public Object clone(CopyContext context) {
return new MyClass(this, context);
}
private Object someReference;
private IEvaluator evaluatorReference;
clone
in interface ICloneWithContext
clone
in class DefinitionalObject
context
- The context to use to perform the copy.protected boolean checkForSameDefinition(DefinitionalObject other)
true
if it does. Derived classes MUST override this method and check
all new fields introduced by the derived class for definitional equivalence. It is NOT necessary
to check base class fields because the base class will already have done that. When overriding this method,
you should NOT call the base implementation because it will return false
for all derived-class instances.
Derived classes should check the type of other
to preserve the symmetric nature of IEquatableDefinition.isSameDefinition(java.lang.Object)
.checkForSameDefinition
in class DefinitionalObject
other
- The other instance to compare to this one.true
if the two objects are defined equivalently; otherwise false
.protected int computeCurrentDefinitionHashCode()
USStandardAtmosphere1976.checkForSameDefinition(agi.foundation.infrastructure.DefinitionalObject)
method.computeCurrentDefinitionHashCode
in class DefinitionalObject
@Nonnull public final ScalarDependentOnServiceProvider getDensity()
ScalarDependentOnServiceProvider
that calculates atmospheric density
using the U.S. Standard Atmosphere model, 1976 version, in kg/m^3.
The calculation requires the given service provider to provide the ILocationPointService
service.@Nonnull public final ScalarDependentOnServiceProvider getTemperature()
ScalarDependentOnServiceProvider
that calculates temperature
using the U.S. Standard Atmosphere model, 1976 version, in kelvin.
The calculation requires the given service provider to provide the ILocationPointService
service.@Nonnull public final ScalarDependentOnServiceProvider getPressure()
ScalarDependentOnServiceProvider
that calculates atmospheric pressure
using the U.S. Standard Atmosphere model, 1976 version, in pascals.
The calculation requires the given service provider to provide the ILocationPointService
service.@Nonnull public final ScalarDependentOnServiceProvider getSpeedOfSound()
ScalarDependentOnServiceProvider
that calculates the speed of sound
using the U.S. Standard Atmosphere model, 1976 version, in m/s.
The calculation requires the given service provider to provide the ILocationPointService
service.@Nonnull public final ScalarDependentOnServiceProvider getDensityRatio()
ScalarDependentOnServiceProvider
that calculates the ratio
of the local density to the density at sea level
using the U.S. Standard Atmosphere model, 1976 version.
The calculation requires the given service provider to provide the ILocationPointService
service.@Nonnull public final Evaluator<USStandardAtmosphere1976.Result> getEvaluator(@Nonnull IServiceProvider serviceProvider)
serviceProvider
- The service provider to use when calculating the value. This service provider must provide the ILocationPointService
service.@Nonnull public final Evaluator<USStandardAtmosphere1976.Result> getEvaluator(@Nonnull EvaluatorGroup group, @Nonnull IServiceProvider serviceProvider)
group
- The group with which to associate the new evaluator. By grouping evaluators
that are often evaluated at the same Julian dates, common computations can be performed only once
for the entire group instead of multiple times for each evaluator.serviceProvider
- The service provider to use when calculating the value. This service provider must provide the ILocationPointService
service.public final double getEarthRadius()
public final void setEarthRadius(double value)
public final double getEarthSurfaceGravity()
public final void setEarthSurfaceGravity(double value)
public final double getMeanMolecularWeightAtSeaLevel()
public final void setMeanMolecularWeightAtSeaLevel(double value)
public final double getIdealGasConstant()
public final void setIdealGasConstant(double value)
public final double getSpecificHeatRatio()
public final void setSpecificHeatRatio(double value)
@Nonnull public final USStandardAtmosphere1976.Result calculate(double height)
height
- The constant height, in meters above mean sea level.