Package gov.nasa.jpl.resource
Class IntegratingResource
java.lang.Object
gov.nasa.jpl.resource.Resource<Double>
gov.nasa.jpl.resource.DoubleResource
gov.nasa.jpl.resource.IntegratingResource
- All Implemented Interfaces:
ResourceContainer
,PropertyChangeListener
,EventListener
-
Field Summary
Fields inherited from class gov.nasa.jpl.resource.Resource
interpolation, maximum, minimum, possibleStates, subsystem, units
-
Constructor Summary
ConstructorsConstructorDescriptionIntegratingResource
(DoubleResource toFollow, long dtInTics) IntegratingResource
(DoubleResource toFollow, long dtInTics, String subsystem) IntegratingResource
(DoubleResource toFollow, long dtInTics, String subsystem, String units) IntegratingResource
(DoubleResource toFollow, long dtInTics, String subsystem, String units, String interpolation) IntegratingResource
(DoubleResource toFollow, long dtInTics, String subsystem, String units, String interpolation, Double minimum, Double maximum) IntegratingResource
(DoubleResource toFollow, Duration dt) IntegratingResource
(DoubleResource toFollow, Duration dt, String subsystem) IntegratingResource
(DoubleResource toFollow, Duration dt, String subsystem, String units) IntegratingResource
(DoubleResource toFollow, Duration dt, String subsystem, String units, String interpolation) IntegratingResource
(DoubleResource toFollow, Duration dt, String subsystem, String units, String interpolation, Double minimum, Double maximum) -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(double toAdd) Integrating resource does not support the add method because it only tracks the followed resource changes.Overrides currentval to always use interpval for integrating resources.Overrides the parent DoubleResource interpval to also update the followed resource so this resource will be correct during modeling.Returns the default value of the resource before it is set() to a new value.void
void
subtract
(double toSubtract) Integrating resource does not support the subtract method because it only tracks the followed resource changes.void
update()
The update method for this class only updates the followed resource so the current value of this resource is correct.void
Updates the resource that this IntegratingResource is following at the current time.Overrides the parent valueAt.Methods inherited from class gov.nasa.jpl.resource.DoubleResource
getInterpolatedValue, linearlyInterpolate
Methods inherited from class gov.nasa.jpl.resource.Resource
addChangeListener, clearHistory, firstTimeSet, formUniqueName, getChangesDuringWindow, getDataType, getIndices, getInterpolation, getMaximumLimit, getMinimumLimit, getName, getPossibleStates, getSize, getSubsystem, getType, getUniqueName, getUnits, historyIterator, insertRecord, isFrozen, isIndexInArrayedResource, lastTimeSet, lastValue, max, min, nextTimeResourceSetToValue, nextTimeSet, priorTimeResourceSetToValue, priorTimeSet, registerResource, removeChangeListener, resourceHistoryHasElements, set, setFrozen, setIndices, setInterpolation, setMaximumLimit, setMinimumLimit, setName, setSubsystem, setUnits, whenEqualTo, whenGreaterThan, whenGreaterThanOrEqualTo, whenLessThan, whenLessThanOrEqualTo, whenNotEqualTo
-
Constructor Details
-
IntegratingResource
-
IntegratingResource
public IntegratingResource(DoubleResource toFollow, long dtInTics, String subsystem, String units, String interpolation) -
IntegratingResource
-
IntegratingResource
-
IntegratingResource
-
IntegratingResource
-
IntegratingResource
public IntegratingResource(DoubleResource toFollow, Duration dt, String subsystem, String units, String interpolation) -
IntegratingResource
-
IntegratingResource
-
IntegratingResource
-
-
Method Details
-
propertyChange
- Specified by:
propertyChange
in interfacePropertyChangeListener
-
profile
Description copied from class:Resource
Returns the default value of the resource before it is set() to a new value. Must be abstract since different data types have different intuitive defaults.- Overrides:
profile
in classDoubleResource
- Parameters:
t
- The time one wants the default value at. Used for custom resources that may have time-varying profiles.- Returns:
-
updateFollowResource
public void updateFollowResource()Updates the resource that this IntegratingResource is following at the current time. This will only update the value if there is not already a data point at the current time and if we are currently modeling. -
interpval
Overrides the parent DoubleResource interpval to also update the followed resource so this resource will be correct during modeling.- Overrides:
interpval
in classDoubleResource
- Parameters:
t
- The time at which you want the interpolated value of the resource- Returns:
- The value of the resource as interpolated between two explicitly calculated values
-
valueAt
Overrides the parent valueAt. This always performs interpolation when available for the values defined in IntegratingResource. However, this method does not interpolate the followed resource values when calculating the integrating resource value. -
currentval
Overrides currentval to always use interpval for integrating resources.- Overrides:
currentval
in classResource<Double>
- Returns:
- Returns the value of the resource at the current simulated time.
-
add
public void add(double toAdd) Integrating resource does not support the add method because it only tracks the followed resource changes.- Overrides:
add
in classDoubleResource
-
subtract
public void subtract(double toSubtract) Integrating resource does not support the subtract method because it only tracks the followed resource changes.- Overrides:
subtract
in classDoubleResource
-
update
public void update()The update method for this class only updates the followed resource so the current value of this resource is correct.- Specified by:
update
in interfaceResourceContainer
- Overrides:
update
in classDoubleResource
-