public abstract class AbstractCumulativeEnergyCalculator extends Object
| Modifier and Type | Method and Description |
|---|---|
org.jscience.physics.amount.Amount<javax.measure.quantity.Energy> |
calculateNext(javax.measure.Measurable<javax.measure.quantity.Power> newPowerSample)
Calculates the next energy sample, i.e., the next integration step is done.
|
static javax.measure.unit.Unit<javax.measure.quantity.Energy> |
getDefaultResultUnit()
Gets the energy unit which is used by default.
|
org.jscience.physics.amount.Amount<javax.measure.quantity.Duration> |
getInitialOffset()
Gets the initial offset.
|
javax.measure.unit.Unit<javax.measure.quantity.Energy> |
getResultUnit()
Gets the unit in which the calculated energy samples are expressed.
|
org.jscience.physics.amount.Amount<javax.measure.quantity.Duration> |
getSamplingPeriod()
Gets the current sampling period, i.e, the temporal difference between two consecutive power samples.
|
void |
reset()
Resets the state of this instance.
|
void |
setOffset(javax.measure.Measurable<javax.measure.quantity.Duration> initialOffset)
Sets the initial offset, i.e., the temporal offset of the first power sample.
|
void |
setSamplingPeriod(javax.measure.Measurable<javax.measure.quantity.Duration> samplingPeriod)
Sets the sampling period, i.e., the temporal difference between the next consecutive power samples.
|
public void reset()
0s, the sampling period is set to default (10s)
and all so far calculated energy samples are discarded. Additionally, all power samples kept for calculation are cleared.public void setSamplingPeriod(javax.measure.Measurable<javax.measure.quantity.Duration> samplingPeriod)
samplingPeriod - A Measurable denoting the sampling period,
i.e., the temporal difference between two consecutive power samples.IllegalArgumentException - In case the given duration is null or not positivepublic void setOffset(javax.measure.Measurable<javax.measure.quantity.Duration> initialOffset)
initialOffset - A Measurable denoting the temporal offset, i.e., the point in time it was taken.IllegalArgumentException - In case initialOffset is null or negativepublic org.jscience.physics.amount.Amount<javax.measure.quantity.Duration> getInitialOffset()
Amount denoting the temporal offset of the first sampling point/power sample.public org.jscience.physics.amount.Amount<javax.measure.quantity.Duration> getSamplingPeriod()
Amount denoting the sampling period.public javax.measure.unit.Unit<javax.measure.quantity.Energy> getResultUnit()
Unit denoting an energy unit.public static javax.measure.unit.Unit<javax.measure.quantity.Energy> getDefaultResultUnit()
Unit denoting Wh (watt-hours).PowerModelConstants.WATT_HOURSpublic final org.jscience.physics.amount.Amount<javax.measure.quantity.Energy> calculateNext(javax.measure.Measurable<javax.measure.quantity.Power> newPowerSample)
newPowerSample - A Measurable holding the (most recent) power sample to be used for calculation.Amount holding the calculated cumulative energy sample.IllegalArgumentException - In case the given power sample is null.