Class MovingAverageTraceFunction
java.lang.Object
microsim.statistics.functions.AbstractFunction
microsim.statistics.functions.MovingAverageTraceFunction
- All Implemented Interfaces:
EventListener, IDoubleSource, IUpdatableSource
@Deprecated(forRemoval=true)
public class MovingAverageTraceFunction
extends AbstractFunction
implements IDoubleSource
Deprecated, for removal: This API element is subject to removal in a future version.
This class computes the average of the last values collected from a data
source.
The number of values used to compute the average value is specified in the
constructor.
The mean function return always double values, so it implements only the
IDoubleSource interface.
Title: JAS
Description: Java Agent-based Simulation library
Copyright (C) 2002 Michele Sonnessa
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.- Author:
- Michele Sonnessa, Ross Richardson
-
Nested Class Summary
Nested classes/interfaces inherited from interface IDoubleSource
IDoubleSource.Variables -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected doubleDeprecated, for removal: This API element is subject to removal in a future version.protected IDoubleSourceDeprecated, for removal: This API element is subject to removal in a future version.protected IFloatSourceDeprecated, for removal: This API element is subject to removal in a future version.protected IIntSourceDeprecated, for removal: This API element is subject to removal in a future version.protected intDeprecated, for removal: This API element is subject to removal in a future version.protected ILongSourceDeprecated, for removal: This API element is subject to removal in a future version.protected intDeprecated, for removal: This API element is subject to removal in a future version.protected static final intDeprecated, for removal: This API element is subject to removal in a future version.protected static final intDeprecated, for removal: This API element is subject to removal in a future version.protected static final intDeprecated, for removal: This API element is subject to removal in a future version.protected static final intDeprecated, for removal: This API element is subject to removal in a future version.protected intDeprecated, for removal: This API element is subject to removal in a future version.protected Enum<?> Deprecated, for removal: This API element is subject to removal in a future version.protected double[]Deprecated, for removal: This API element is subject to removal in a future version.Fields inherited from class AbstractFunction
timeChecker -
Constructor Summary
ConstructorsConstructorDescriptionMovingAverageTraceFunction(IDoubleSource source, Enum<?> valueID, int windowSize) Deprecated, for removal: This API element is subject to removal in a future version.Create a basic statistic probe on a IDoubleSource object.MovingAverageTraceFunction(IFloatSource source, Enum<?> valueID, int windowSize) Deprecated, for removal: This API element is subject to removal in a future version.Create a basic statistic probe on a IFloatSource object.MovingAverageTraceFunction(IIntSource source, Enum<?> valueID, int windowSize) Deprecated, for removal: This API element is subject to removal in a future version.Create a basic statistic probe on a IIntSource object.MovingAverageTraceFunction(ILongSource source, Enum<?> valueID, int windowSize) Deprecated, for removal: This API element is subject to removal in a future version.Create a basic statistic probe on a ILongSource object. -
Method Summary
Modifier and TypeMethodDescriptionvoidDeprecated, for removal: This API element is subject to removal in a future version.Collect a value from the source.doublegetDoubleValue(Enum<?> valueID) Deprecated, for removal: This API element is subject to removal in a future version.Return the result of a given statistic.voidDeprecated, for removal: This API element is subject to removal in a future version.ISimEventListener callback function.Methods inherited from class AbstractFunction
isCheckingTime, setCheckingTime, updateSource
-
Field Details
-
TYPE_DBL
protected static final int TYPE_DBLDeprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
TYPE_FLT
protected static final int TYPE_FLTDeprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
TYPE_INT
protected static final int TYPE_INTDeprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
TYPE_LNG
protected static final int TYPE_LNGDeprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
dblSource
Deprecated, for removal: This API element is subject to removal in a future version. -
fltSource
Deprecated, for removal: This API element is subject to removal in a future version. -
intSource
Deprecated, for removal: This API element is subject to removal in a future version. -
lngSource
Deprecated, for removal: This API element is subject to removal in a future version. -
type
protected int typeDeprecated, for removal: This API element is subject to removal in a future version. -
valueID
Deprecated, for removal: This API element is subject to removal in a future version. -
len
protected int lenDeprecated, for removal: This API element is subject to removal in a future version. -
values
protected double[] valuesDeprecated, for removal: This API element is subject to removal in a future version. -
average
protected double averageDeprecated, for removal: This API element is subject to removal in a future version. -
valueCount
protected int valueCountDeprecated, for removal: This API element is subject to removal in a future version.
-
-
Constructor Details
-
MovingAverageTraceFunction
Deprecated, for removal: This API element is subject to removal in a future version.Create a basic statistic probe on a IDoubleSource object.- Parameters:
source- The IDoubleSource object.valueID- The value identifier defined by source object.
-
MovingAverageTraceFunction
Deprecated, for removal: This API element is subject to removal in a future version.Create a basic statistic probe on a IFloatSource object.- Parameters:
source- The IFloatSource object.valueID- The value identifier defined by source object.
-
MovingAverageTraceFunction
Deprecated, for removal: This API element is subject to removal in a future version.Create a basic statistic probe on a ILongSource object.- Parameters:
source- The ILongSource object.valueID- The value identifier defined by source object.
-
MovingAverageTraceFunction
Deprecated, for removal: This API element is subject to removal in a future version.Create a basic statistic probe on a IIntSource object.- Parameters:
source- The IIntSource object.valueID- The value identifier defined by source object.
-
-
Method Details
-
applyFunction
public void applyFunction()Deprecated, for removal: This API element is subject to removal in a future version.Collect a value from the source.- Specified by:
applyFunctionin classAbstractFunction
-
getDoubleValue
Deprecated, for removal: This API element is subject to removal in a future version.Return the result of a given statistic.- Specified by:
getDoubleValuein interfaceIDoubleSource- Parameters:
valueID- One of the F_ constants representing available statistics.- Returns:
- The computed value.
- Throws:
UnsupportedOperationException- If the given valueID is not supported.
-
onEvent
Deprecated, for removal: This API element is subject to removal in a future version.ISimEventListener callback function. It supports only jas.engine.Sim.EVENT_UPDATE event.- Specified by:
onEventin interfaceEventListener- Overrides:
onEventin classAbstractFunction- Throws:
UnsupportedOperationException- If actionType is not supported.
-
AccumulatorStats